generate 接口参数变更
This commit is contained in:
@@ -88,6 +88,9 @@ public class GenerateConsumer {
|
||||
channel.basicAck(msg.getMessageProperties().getDeliveryTag(), false);
|
||||
// 将消息从redis排队队列中删除,需保证被消费的消息存储到db之后再从redis删除
|
||||
redisUtil.removeFromZSet(consumptionOrderKey, uniqueId);
|
||||
String key = generateResultKey + ":" + uniqueId;
|
||||
GenerateResultVO generateResultVO = new GenerateResultVO(generateThroughImageTextDTO.getUniqueId(), null, null, "Fail");
|
||||
redisUtil.addToString(key, new Gson().toJson(generateResultVO), CommonConstant.GENERATE_RESULT_EXPIRE_TIME);
|
||||
} catch (IOException exception) {
|
||||
log.error("手动确认,取消返回队列,不再重新消费");
|
||||
}
|
||||
@@ -115,9 +118,10 @@ public class GenerateConsumer {
|
||||
try {
|
||||
log.info("tasks_id : {} start ", generateResult.get("tasks_id"));
|
||||
if (generateResult.get("status").equals("SUCCESS")) {
|
||||
String url = generateResult.get("data");
|
||||
String url = generateResult.get("image_url");
|
||||
String taskId = generateResult.get("tasks_id");
|
||||
generateService.processGenerateResult(taskId, url);
|
||||
String category = generateResult.get("category");
|
||||
generateService.processGenerateResult(taskId, url, category);
|
||||
} else {
|
||||
// 修改redis中的数据状态为exception
|
||||
String key = generateResultKey + ":" + generateResult.get("tasks_id");
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package com.ai.da.common.constant;
|
||||
|
||||
public class CommonConstant {
|
||||
// 单位 秒 一天过期
|
||||
public static final Long TASK_EXPIRE_TIME = 24 * 60 * 60L;
|
||||
// 单位 秒 10分钟过期
|
||||
// public static final Long TASK_EXPIRE_TIME = 24 * 60 * 60L;
|
||||
public static final Long TASK_EXPIRE_TIME = 10 * 60L;
|
||||
// 单位 秒 两天过期
|
||||
public static final Long CREDITS_EXPIRE_TIME = 2 * 24 * 60 * 60L;
|
||||
// 单位 分钟
|
||||
|
||||
Reference in New Issue
Block a user