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] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=8A=E6=B8=B8=E6=9E=84?= =?UTF-8?q?=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)