Compare commits
No commits in common. "06f7246d3562c01d5d935b99d14ba1f59fdd311c" and "2d03a13227518d59b9e7c034b4a6dc9cec7e607d" have entirely different histories.
06f7246d35
...
2d03a13227
@ -18,15 +18,7 @@ func ImageContentGetStatus(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
func ImageContentGetResult(c *gin.Context) {
|
||||
processor := GetBatchProcessorEx()
|
||||
if processor == nil {
|
||||
service.Success(c, gin.H{
|
||||
"status": 0,
|
||||
"status_description": StatusMap[0],
|
||||
"message": "暂无执行中的任务",
|
||||
})
|
||||
return
|
||||
}
|
||||
processor := GetBatchProcessorRead()
|
||||
currentStatus := processor.GetStatus()
|
||||
switch currentStatus {
|
||||
case StatusIdle:
|
||||
|
||||
@ -67,10 +67,6 @@ type ImageTask struct {
|
||||
Content string //内容
|
||||
}
|
||||
|
||||
func GetBatchProcessorEx() *BatchProcessor {
|
||||
return batchProcessor
|
||||
}
|
||||
|
||||
func GetBatchProcessorRead() *BatchProcessor {
|
||||
getBatchProcessorReadMutex.Lock()
|
||||
defer getBatchProcessorReadMutex.Unlock()
|
||||
@ -87,8 +83,8 @@ func GetBatchProcessorRead() *BatchProcessor {
|
||||
}
|
||||
|
||||
func GetBatchProcessor() *BatchProcessor {
|
||||
getBatchProcessorReadMutex.Lock()
|
||||
defer getBatchProcessorReadMutex.Unlock()
|
||||
getBatchProcessorMutex.Lock()
|
||||
defer getBatchProcessorMutex.Unlock()
|
||||
|
||||
if batchProcessor == nil || batchProcessor.status == StatusCompleted {
|
||||
batchProcessor = &BatchProcessor{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user