超时退出

This commit is contained in:
Van0313
2025-04-29 10:21:55 +08:00
parent f379fd65a8
commit abfbfec790

View File

@@ -641,7 +641,7 @@ public class JDUtil {
LocalDateTime lastInteractionTime = LocalDateTime.parse(state.getLastInteractionTime(), DATE_TIME_FORMATTER);
if (ChronoUnit.MINUTES.between(lastInteractionTime, now) > TIMEOUT_MINUTES) {
String wxid = key.replace(INTERACTION_STATE_PREFIX, "");
wxUtil.sendTextMessage(wxid, "长时间未操作,已退出会话", 1, wxid, false);
wxUtil.sendTextMessage(wxid, TIMEOUT_MINUTES + " 分钟未操作,已退出会话", 1, wxid, false);
redisTemplate.delete(key);
logger.debug("Deleted timeout state for key: {}", key);
}