mirror of
https://github.com/linux-do/new-api.git
synced 2025-09-19 00:46:37 +08:00
Midjourney Proxy Plus无实例账号自动禁用该渠道
This commit is contained in:
parent
c1040afed9
commit
a47111a031
@ -538,7 +538,16 @@ func RelayMidjourneySubmit(c *gin.Context, relayMode int) *dto.MidjourneyRespons
|
||||
ChannelId: c.GetInt("channel_id"),
|
||||
Quota: quota,
|
||||
}
|
||||
|
||||
if midjResponse.Code == 3 {
|
||||
//无实例账号自动禁用渠道(No available account instance)
|
||||
channel, err := model.GetChannelById(midjourneyTask.ChannelId, true)
|
||||
if err != nil {
|
||||
common.SysError("get_channel_null: " + err.Error())
|
||||
}
|
||||
if channel.AutoBan != nil && *channel.AutoBan == 1 {
|
||||
model.UpdateChannelStatusById(midjourneyTask.ChannelId, 2)
|
||||
}
|
||||
}
|
||||
if midjResponse.Code != 1 && midjResponse.Code != 21 && midjResponse.Code != 22 {
|
||||
//非1-提交成功,21-任务已存在和22-排队中,则记录错误原因
|
||||
midjourneyTask.FailReason = midjResponse.Description
|
||||
|
Loading…
Reference in New Issue
Block a user