diff --git a/controller/midjourney.go b/controller/midjourney.go index 3e0faff..e1659d9 100644 --- a/controller/midjourney.go +++ b/controller/midjourney.go @@ -148,12 +148,6 @@ import ( */ func UpdateMidjourneyTaskBulk() { - //revocer - defer func() { - if err := recover(); err != nil { - log.Printf("UpdateMidjourneyTask panic: %v", err) - } - }() //imageModel := "midjourney" ctx := context.TODO() for { diff --git a/main.go b/main.go index 3675d62..19ae54a 100644 --- a/main.go +++ b/main.go @@ -85,7 +85,9 @@ func main() { } go controller.AutomaticallyTestChannels(frequency) } - go controller.UpdateMidjourneyTaskBulk() + common.SafeGoroutine(func() { + controller.UpdateMidjourneyTaskBulk() + }) if os.Getenv("BATCH_UPDATE_ENABLED") == "true" { common.BatchUpdateEnabled = true common.SysLog("batch update enabled with interval " + strconv.Itoa(common.BatchUpdateInterval) + "s")