mirror of
https://github.com/linux-do/new-api.git
synced 2025-11-05 13:53:42 +08:00
feat: only update task on master node
This commit is contained in:
@@ -19,9 +19,6 @@ import (
|
||||
)
|
||||
|
||||
func UpdateMidjourneyTaskBulk() {
|
||||
if !common.IsMasterNode {
|
||||
return
|
||||
}
|
||||
//imageModel := "midjourney"
|
||||
ctx := context.TODO()
|
||||
for {
|
||||
|
||||
2
main.go
2
main.go
@@ -89,12 +89,14 @@ func main() {
|
||||
}
|
||||
go controller.AutomaticallyTestChannels(frequency)
|
||||
}
|
||||
if common.IsMasterNode {
|
||||
common.SafeGoroutine(func() {
|
||||
controller.UpdateMidjourneyTaskBulk()
|
||||
})
|
||||
common.SafeGoroutine(func() {
|
||||
controller.UpdateTaskBulk()
|
||||
})
|
||||
}
|
||||
if os.Getenv("BATCH_UPDATE_ENABLED") == "true" {
|
||||
common.BatchUpdateEnabled = true
|
||||
common.SysLog("batch update enabled with interval " + strconv.Itoa(common.BatchUpdateInterval) + "s")
|
||||
|
||||
3145
web/pnpm-lock.yaml
generated
3145
web/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user