Browse Source

优化touch

zhou-hao 4 years ago
parent
commit
14a958cf2b

+ 4 - 2
hsweb-authorization/hsweb-authorization-api/src/main/java/org/hswebframework/web/authorization/token/redis/RedisUserTokenManager.java

@@ -271,8 +271,10 @@ public class RedisUserTokenManager implements UserTokenManager {
         SimpleUserToken inCache = localCache.get(token);
         if (inCache != null && inCache.isNormal()) {
             inCache.setLastRequestTime(System.currentTimeMillis());
-            //异步touch
-            touchSink.next(inCache);
+            if (inCache.getMaxInactiveInterval() > 0) {
+                //异步touch
+                touchSink.next(inCache);
+            }
             return Mono.empty();
         }
         return getByToken(token)