记得上下班打卡 | git大法好,push需谨慎

Commit 6b439fbd authored by 张国柄's avatar 张国柄

~opt:queue.order.close;

parent 2663736c
...@@ -53,7 +53,7 @@ public abstract class AbstractOrderCloseReceiver implements StreamListener<Strin ...@@ -53,7 +53,7 @@ public abstract class AbstractOrderCloseReceiver implements StreamListener<Strin
stringRedisTemplate.opsForStream().acknowledge(getRedisStreamGroup(), message); stringRedisTemplate.opsForStream().acknowledge(getRedisStreamGroup(), message);
stringRedisTemplate.opsForStream().delete(this.getRedisStreamKey(), message.getId()); stringRedisTemplate.opsForStream().delete(this.getRedisStreamKey(), message.getId());
} catch (Exception e) { } catch (Exception e) {
log.error("#CONSUMER SQL RESULT:{} ==> DEL_REDIS_QUEUE_MSG_EXCEPTION[MESSAGE_ID:{},MSG:{}]", result, message.getId(), JsonUtils.toJson(message), e); log.error("#CONSUMER ORDER_CLOSE RESULT:{} ==> DEL_REDIS_QUEUE_MSG_EXCEPTION[MESSAGE_ID:{},MSG:{}]", result, message.getId(), message.getValue(), e);
} finally { } finally {
try { try {
stringRedisTemplate.opsForStream().acknowledge(getRedisStreamGroup(), message); stringRedisTemplate.opsForStream().acknowledge(getRedisStreamGroup(), message);
...@@ -67,12 +67,11 @@ public abstract class AbstractOrderCloseReceiver implements StreamListener<Strin ...@@ -67,12 +67,11 @@ public abstract class AbstractOrderCloseReceiver implements StreamListener<Strin
try { try {
String orderCode = messageMap.get("id"), type = messageMap.get("type"), time = messageMap.get("time"); String orderCode = messageMap.get("id"), type = messageMap.get("type"), time = messageMap.get("time");
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now(), closeTime = now.minusMinutes(5);
LocalDateTime createdAt = StringUtils.isEmpty(time) ? now.minusMinutes(5) : LocalDateTime.parse(time); LocalDateTime createdAt = StringUtils.isEmpty(time) ? closeTime : LocalDateTime.parse(time);
long durationToMillis = Duration.between(createdAt, closeTime).toMillis();
long durationToMillis = Duration.between(createdAt.plusMinutes(5), now).toMillis(); if (durationToMillis >= 0) {
if (durationToMillis > 0) {
return checkOrderTime(orderCode, type); return checkOrderTime(orderCode, type);
} else { } else {
try { try {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment