From 706449dede9bda59f617dd2dac971f7f59a345e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=99=E7=94=9F=E4=B8=80=E4=B8=AA=E7=99=BD=E6=81=A9?= <591698275@qq.com> Date: Sat, 30 Mar 2024 13:21:05 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=8A=E6=B8=B8?= =?UTF-8?q?=E6=9E=84=E5=9B=BE=E5=A4=B1=E8=B4=A5=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controller/midjourney.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/controller/midjourney.go b/controller/midjourney.go index 41db4bf..313bae2 100644 --- a/controller/midjourney.go +++ b/controller/midjourney.go @@ -5,7 +5,6 @@ import ( "context" "encoding/json" "fmt" - "github.com/gin-gonic/gin" "io" "log" "net/http" @@ -16,6 +15,8 @@ import ( "strconv" "strings" "time" + + "github.com/gin-gonic/gin" ) func UpdateMidjourneyTaskBulk() { @@ -147,7 +148,7 @@ func UpdateMidjourneyTaskBulk() { task.Buttons = string(buttonStr) } - if task.Progress != "100%" && responseItem.FailReason != "" { + if task.Progress != "100%" && responseItem.FailReason != "" || task.Progress == "100%" && task.Status == "FAILURE" { common.LogInfo(ctx, task.MjId+" 构建失败,"+task.FailReason) task.Progress = "100%" err = model.CacheUpdateUserQuota(task.UserId) From f7a4f18aff63daf318884b5bb99c67537d45cad1 Mon Sep 17 00:00:00 2001 From: Calcium-Ion <61247483+Calcium-Ion@users.noreply.github.com> Date: Sat, 30 Mar 2024 16:26:39 +0800 Subject: [PATCH 2/2] Update midjourney.go --- controller/midjourney.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/controller/midjourney.go b/controller/midjourney.go index 313bae2..b5b832b 100644 --- a/controller/midjourney.go +++ b/controller/midjourney.go @@ -5,6 +5,7 @@ import ( "context" "encoding/json" "fmt" + "github.com/gin-gonic/gin" "io" "log" "net/http" @@ -15,8 +16,6 @@ import ( "strconv" "strings" "time" - - "github.com/gin-gonic/gin" ) func UpdateMidjourneyTaskBulk() { @@ -148,7 +147,7 @@ func UpdateMidjourneyTaskBulk() { task.Buttons = string(buttonStr) } - if task.Progress != "100%" && responseItem.FailReason != "" || task.Progress == "100%" && task.Status == "FAILURE" { + if (task.Progress != "100%" && responseItem.FailReason != "") || (task.Progress == "100%" && task.Status == "FAILURE") { common.LogInfo(ctx, task.MjId+" 构建失败,"+task.FailReason) task.Progress = "100%" err = model.CacheUpdateUserQuota(task.UserId)