From 7a86d3b83f9154221f8bba17b159d56129d03264 Mon Sep 17 00:00:00 2001 From: chenjiahe <763432473@qq.com> Date: 星期五, 14 七月 2023 15:01:48 +0800 Subject: [PATCH] 拦截器优化 --- src/main/java/com/hx/redis/RedisUtil.java | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/hx/redis/RedisUtil.java b/src/main/java/com/hx/redis/RedisUtil.java index 6f380eb..d9b582b 100644 --- a/src/main/java/com/hx/redis/RedisUtil.java +++ b/src/main/java/com/hx/redis/RedisUtil.java @@ -151,15 +151,14 @@ public boolean expire(String key, long time, TimeUnit timeUnit) { try { if (time > 0) { - redisTemplate.expire(key, time, timeUnit); + return redisTemplate.expire(key, time, timeUnit); } - return true; } catch (Exception e) { e.printStackTrace(); return false; } - + return false; } -- Gitblit v1.8.0