|
|
@@ -414,6 +414,16 @@ public class MidjourneyServiceImpl implements MidjourneyService {
|
|
|
});
|
|
|
//失败返还次数
|
|
|
if ("FAILURE".equals(conversation.getStatus())){
|
|
|
+ if (StringUtils.equals("未知频道",conversation.getFailReason())) {
|
|
|
+ redisService.hdel(RedisService.key.MIDJOURNEY_ACCOUNT.getName(),dbConversation.getInstanceId());
|
|
|
+ String finalAccountWithMinUsage = dbConversation.getInstanceId().toString();
|
|
|
+ TASK_EXECUTOR.execute(() -> {
|
|
|
+ MidjourneyAccount account = midjourneyAccountService.getOne(Wrappers.lambdaQuery(MidjourneyAccount.class).eq(MidjourneyAccount::getInstanceId, finalAccountWithMinUsage).last("limit 1"));
|
|
|
+ if (account.getStatus()) {
|
|
|
+ midjourneyAccountService.updateStatus(account.getId());
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
Object num = redisService.get(RedisService.key.MIDJOURNEY_RELAX_LIMIT.getName() + userId);
|
|
|
LambdaUpdateWrapper<MidjourneyUser> wrapper = Wrappers.lambdaUpdate(MidjourneyUser.class)
|
|
|
.eq(MidjourneyUser::getId, userId);
|