chenbiao 2 년 전
부모
커밋
7c2641eaac

+ 1 - 1
midjourney/src/main/java/com/yhlxj/redis/RedisService.java

@@ -751,7 +751,7 @@ public class RedisService {
         MIDJOURNEY_EXPIRE_TIME("midjourney:expire:time:", "midjourney expire time", 60 * 60 * 48L),
         MIDJOURNEY_USER("midjourney:user:", "midjourney user", 60 * 60 * 2L),
         MIDJOURNEY_CONVERSATION("midjourney:conversation:", "midjourney conversation", 60 * 60 * 5L),
-        MIDJOURNEY_ACCOUNT("midjourney:account:", "midjourney account", 60 * 60 * 2L),
+        MIDJOURNEY_ACCOUNT("midjourney:account:", "midjourney account", 60 * 60 * 1L),
         MIDJOURNEY_QUERY("midjourney:query:", "midjourney query", 60 * 60 * 2L),
         MIDJOURNEY_PROGRESS("midjourney:task:progress:","task progress 任务进度", 60 * 60 * 1L),
         MIDJOURNEY_USER_TIME("midjourney:user:time:", "midjourney user time", 60 * 60 * 24L),

+ 5 - 3
midjourney/src/main/java/com/yhlxj/service/midjourney/impl/MidjourneyServiceImpl.java

@@ -1,5 +1,6 @@
 package com.yhlxj.service.midjourney.impl;
 
+import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.io.FileUtil;
 import cn.hutool.core.map.MapUtil;
@@ -78,7 +79,7 @@ public class MidjourneyServiceImpl implements MidjourneyService {
 
     private final MidjourneyUserConversationMapper conversationMapper;
 
-    private static final List<String> progress = List.of("100%");
+    private static final List<String> progress = List.of("35%","65%","100%");
 
     private static final List<String> status = List.of("MODAL","CANCEL","FAILURE");
 
@@ -978,7 +979,9 @@ public class MidjourneyServiceImpl implements MidjourneyService {
 
         TASK_EXECUTOR.execute(() -> {
             try {
-                sync(conversation);
+                MidjourneyUserConversation conversation1 = new MidjourneyUserConversation();
+                BeanUtil.copyProperties(conversation, conversation1);
+                sync(conversation1);
             } catch (Exception e) {
                 log.error("同步任务出错 taskId:{}, error:{}", conversation.getTaskId(), StringUtil.getErrorText(e));
             }
@@ -1010,7 +1013,6 @@ public class MidjourneyServiceImpl implements MidjourneyService {
         //WebSocket 直接发送 任务状态
         WssSession wssSession = WSS_SESSION_MAP.get(conversation.getUserId());
         if (wssSession != null) {
-            conversation.setUserId(null);
             conversation.setChannelId(null);
             conversation.setInstanceId(null);
             if(JSONUtil.isJson(conversation.getProperties())){