From e40d58ae9d4a56a608f5fb63d18a97bfcbcd659f Mon Sep 17 00:00:00 2001 From: OTTO <731554297@qq.com> Date: Fri, 7 Mar 2025 15:33:22 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=BE=AE=E6=9C=8D=E5=8A=A1=E6=B2=BB?= =?UTF-8?q?=E7=90=86=E5=B7=A5=E5=85=B7):=20=E4=BC=98=E5=8C=96Sentinel?= =?UTF-8?q?=E5=85=8D=E7=99=BB=E5=BD=95=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sentinel登录状态默认30分钟失效,将Sentinel Token缓存过期时间调整为28分钟 Signed-off-by: OTTO <731554297@qq.com> --- .../gateway/service/impl/ThirdPartyToolServiceImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/microservices-gateway/src/main/java/com/microservices/gateway/service/impl/ThirdPartyToolServiceImpl.java b/microservices-gateway/src/main/java/com/microservices/gateway/service/impl/ThirdPartyToolServiceImpl.java index bb60f28ba..0cf7dfea7 100644 --- a/microservices-gateway/src/main/java/com/microservices/gateway/service/impl/ThirdPartyToolServiceImpl.java +++ b/microservices-gateway/src/main/java/com/microservices/gateway/service/impl/ThirdPartyToolServiceImpl.java @@ -90,7 +90,8 @@ public class ThirdPartyToolServiceImpl implements ThirdPartyToolService { Map> header = response.headers(); if (header != null && header.containsKey("set-cookie")) { sentinelCookie = header.get("set-cookie").iterator().next(); - redisService.setCacheObject(CacheConstants.SENTINEL_TOKEN, sentinelCookie, 12L, TimeUnit.HOURS); + //Sentinel登录状态默认30分钟失效,将Sentinel Token缓存过期时间调整为28分钟 + redisService.setCacheObject(CacheConstants.SENTINEL_TOKEN, sentinelCookie, 28L, TimeUnit.MINUTES); } } catch (TimeoutException e) { log.error("获取Sentinel Token超时");