mirror of
https://github.com/linux-do/new-api.git
synced 2025-09-18 00:16:37 +08:00
feat: only update task on master node
This commit is contained in:
parent
11be36dafd
commit
cadd8aa622
@ -19,9 +19,6 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func UpdateMidjourneyTaskBulk() {
|
func UpdateMidjourneyTaskBulk() {
|
||||||
if !common.IsMasterNode {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
//imageModel := "midjourney"
|
//imageModel := "midjourney"
|
||||||
ctx := context.TODO()
|
ctx := context.TODO()
|
||||||
for {
|
for {
|
||||||
|
2
main.go
2
main.go
@ -89,12 +89,14 @@ func main() {
|
|||||||
}
|
}
|
||||||
go controller.AutomaticallyTestChannels(frequency)
|
go controller.AutomaticallyTestChannels(frequency)
|
||||||
}
|
}
|
||||||
|
if common.IsMasterNode {
|
||||||
common.SafeGoroutine(func() {
|
common.SafeGoroutine(func() {
|
||||||
controller.UpdateMidjourneyTaskBulk()
|
controller.UpdateMidjourneyTaskBulk()
|
||||||
})
|
})
|
||||||
common.SafeGoroutine(func() {
|
common.SafeGoroutine(func() {
|
||||||
controller.UpdateTaskBulk()
|
controller.UpdateTaskBulk()
|
||||||
})
|
})
|
||||||
|
}
|
||||||
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")
|
||||||
|
3141
web/pnpm-lock.yaml
3141
web/pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user