Ver código fonte

feat: only update task on master node

CalciumIon 1 ano atrás
pai
commit
cadd8aa622
3 arquivos alterados com 1507 adições e 638 exclusões
  1. 0 3
      controller/midjourney.go
  2. 8 6
      main.go
  3. 1499 629
      web/pnpm-lock.yaml

+ 0 - 3
controller/midjourney.go

@@ -19,9 +19,6 @@ import (
 )
 
 func UpdateMidjourneyTaskBulk() {
-	if !common.IsMasterNode {
-		return
-	}
 	//imageModel := "midjourney"
 	ctx := context.TODO()
 	for {

+ 8 - 6
main.go

@@ -89,12 +89,14 @@ func main() {
 		}
 		go controller.AutomaticallyTestChannels(frequency)
 	}
-	common.SafeGoroutine(func() {
-		controller.UpdateMidjourneyTaskBulk()
-	})
-	common.SafeGoroutine(func() {
-		controller.UpdateTaskBulk()
-	})
+	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")

Diferenças do arquivo suprimidas por serem muito extensas
+ 1499 - 629
web/pnpm-lock.yaml


Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff