|
@@ -81,7 +81,7 @@ public class MidjourneyServiceImpl implements MidjourneyService {
|
|
|
|
|
|
|
|
private static final String RELAX_TOKEN = "5a9a3e9b-5a5e-4b6b-9a5a-9a5a5a5a5a5a";
|
|
private static final String RELAX_TOKEN = "5a9a3e9b-5a5e-4b6b-9a5a-9a5a5a5a5a5a";
|
|
|
|
|
|
|
|
- private static final Map<Long, ImgSize> TASK_IMG_SIZE_MAP = new ConcurrentHashMap<>();
|
|
|
|
|
|
|
+ private static final Map<Long, ImgSize> TASK_IMG_SIZE_MAP = new ConcurrentHashMap<>(64);
|
|
|
|
|
|
|
|
private final MidjourneyUserConversationMapper conversationMapper;
|
|
private final MidjourneyUserConversationMapper conversationMapper;
|
|
|
|
|
|
|
@@ -834,6 +834,7 @@ public class MidjourneyServiceImpl implements MidjourneyService {
|
|
|
.eq(MidjourneyUserConversation::getUserId, userId).orderByDesc(MidjourneyUserConversation::getId).last(" limit 1"));
|
|
.eq(MidjourneyUserConversation::getUserId, userId).orderByDesc(MidjourneyUserConversation::getId).last(" limit 1"));
|
|
|
if (dbConversation != null) {
|
|
if (dbConversation != null) {
|
|
|
if ("SUCCESS".equals(dbConversation.getStatus()) || "FAILURE".equals(dbConversation.getStatus())) {
|
|
if ("SUCCESS".equals(dbConversation.getStatus()) || "FAILURE".equals(dbConversation.getStatus())) {
|
|
|
|
|
+ TASK_IMG_SIZE_MAP.remove(dbConversation.getTaskId());
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
if (conversation.getProgressNum() <= dbConversation.getProgressNum() && !conversation.getStatus().equals("FAILURE")){
|
|
if (conversation.getProgressNum() <= dbConversation.getProgressNum() && !conversation.getStatus().equals("FAILURE")){
|
|
@@ -1133,6 +1134,8 @@ public class MidjourneyServiceImpl implements MidjourneyService {
|
|
|
scaling = "quality=lossless&width=" + width + "&height=" + height;
|
|
scaling = "quality=lossless&width=" + width + "&height=" + height;
|
|
|
if (url.getFile().contains("webp")) {
|
|
if (url.getFile().contains("webp")) {
|
|
|
scaling += "&format=webp";
|
|
scaling += "&format=webp";
|
|
|
|
|
+ }else {
|
|
|
|
|
+ TASK_IMG_SIZE_MAP.remove(conversation.getTaskId());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|