This commit is contained in:
hucs
2024-08-28 13:08:49 +08:00
parent 9b0880bcc8
commit 8702e282a5
2 changed files with 21 additions and 11 deletions

View File

@@ -43,12 +43,12 @@ public class OverdueOrderHandlerTask {
}
/**
* 每秒钟检测,判断任务是否到期
* 每10秒钟检测,判断任务是否到期
*
* @author admin
* @since 2024/8/15 13:47
**/
@Scheduled(fixedRate = 1000)
@Scheduled(fixedRate = 10000)
public void processMessages() {
long now = System.currentTimeMillis() / 1000;
Set<String> messages = stringRedisTemplate.opsForZSet().rangeByScore(QUEUE_KEY, 0, now);
@@ -74,7 +74,12 @@ public class OverdueOrderHandlerTask {
}
// 如果订单未接单,进行退款处理
if ("0".equals(orderInfo.getOrderStatus())) {
playOrderInfoService.updateStateTo4("2", "admin", orderInfo.getId(), "订单长时间未接单", new ArrayList<>());
try {
playOrderInfoService.updateStateTo4("2", "admin", orderInfo.getId(), "订单长时间未接单", new ArrayList<>());
}catch (Exception e){
log.error("订单退款失败", e);
}
}
}
}