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