Merge branch 'wwq' into dev
This commit is contained in:
commit
06f7246d35
@ -18,7 +18,15 @@ func ImageContentGetStatus(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
func ImageContentGetResult(c *gin.Context) {
|
||||
processor := GetBatchProcessorRead()
|
||||
processor := GetBatchProcessorEx()
|
||||
if processor == nil {
|
||||
service.Success(c, gin.H{
|
||||
"status": 0,
|
||||
"status_description": StatusMap[0],
|
||||
"message": "暂无执行中的任务",
|
||||
})
|
||||
return
|
||||
}
|
||||
currentStatus := processor.GetStatus()
|
||||
switch currentStatus {
|
||||
case StatusIdle:
|
||||
|
||||
@ -67,6 +67,10 @@ type ImageTask struct {
|
||||
Content string //内容
|
||||
}
|
||||
|
||||
func GetBatchProcessorEx() *BatchProcessor {
|
||||
return batchProcessor
|
||||
}
|
||||
|
||||
func GetBatchProcessorRead() *BatchProcessor {
|
||||
getBatchProcessorReadMutex.Lock()
|
||||
defer getBatchProcessorReadMutex.Unlock()
|
||||
@ -83,8 +87,8 @@ func GetBatchProcessorRead() *BatchProcessor {
|
||||
}
|
||||
|
||||
func GetBatchProcessor() *BatchProcessor {
|
||||
getBatchProcessorMutex.Lock()
|
||||
defer getBatchProcessorMutex.Unlock()
|
||||
getBatchProcessorReadMutex.Lock()
|
||||
defer getBatchProcessorReadMutex.Unlock()
|
||||
|
||||
if batchProcessor == nil || batchProcessor.status == StatusCompleted {
|
||||
batchProcessor = &BatchProcessor{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user