Update midjourney.go

This commit is contained in:
Calcium-Ion 2024-03-30 16:26:39 +08:00 committed by GitHub
parent 706449dede
commit f7a4f18aff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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)