mirror of
https://github.com/linux-do/new-api.git
synced 2025-09-18 00:16:37 +08:00
chore: UpdateMidjourneyTaskBulk with SafeGoroutine
This commit is contained in:
parent
2b3539fcaa
commit
d30b9321b2
@ -148,12 +148,6 @@ import (
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
func UpdateMidjourneyTaskBulk() {
|
func UpdateMidjourneyTaskBulk() {
|
||||||
//revocer
|
|
||||||
defer func() {
|
|
||||||
if err := recover(); err != nil {
|
|
||||||
log.Printf("UpdateMidjourneyTask panic: %v", err)
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
//imageModel := "midjourney"
|
//imageModel := "midjourney"
|
||||||
ctx := context.TODO()
|
ctx := context.TODO()
|
||||||
for {
|
for {
|
||||||
|
4
main.go
4
main.go
@ -85,7 +85,9 @@ func main() {
|
|||||||
}
|
}
|
||||||
go controller.AutomaticallyTestChannels(frequency)
|
go controller.AutomaticallyTestChannels(frequency)
|
||||||
}
|
}
|
||||||
go controller.UpdateMidjourneyTaskBulk()
|
common.SafeGoroutine(func() {
|
||||||
|
controller.UpdateMidjourneyTaskBulk()
|
||||||
|
})
|
||||||
if os.Getenv("BATCH_UPDATE_ENABLED") == "true" {
|
if os.Getenv("BATCH_UPDATE_ENABLED") == "true" {
|
||||||
common.BatchUpdateEnabled = true
|
common.BatchUpdateEnabled = true
|
||||||
common.SysLog("batch update enabled with interval " + strconv.Itoa(common.BatchUpdateInterval) + "s")
|
common.SysLog("batch update enabled with interval " + strconv.Itoa(common.BatchUpdateInterval) + "s")
|
||||||
|
Loading…
Reference in New Issue
Block a user