增加上游构图失败判断

This commit is contained in:
余生一个白恩 2024-03-30 13:21:05 +08:00
parent 36d164be0e
commit 706449dede

View File

@ -5,7 +5,6 @@ import (
"context" "context"
"encoding/json" "encoding/json"
"fmt" "fmt"
"github.com/gin-gonic/gin"
"io" "io"
"log" "log"
"net/http" "net/http"
@ -16,6 +15,8 @@ import (
"strconv" "strconv"
"strings" "strings"
"time" "time"
"github.com/gin-gonic/gin"
) )
func UpdateMidjourneyTaskBulk() { func UpdateMidjourneyTaskBulk() {
@ -147,7 +148,7 @@ func UpdateMidjourneyTaskBulk() {
task.Buttons = string(buttonStr) 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) common.LogInfo(ctx, task.MjId+" 构建失败,"+task.FailReason)
task.Progress = "100%" task.Progress = "100%"
err = model.CacheUpdateUserQuota(task.UserId) err = model.CacheUpdateUserQuota(task.UserId)