From 29c36380f636c0ae22d668c856c03a543bcca1c8 Mon Sep 17 00:00:00 2001 From: fwq <582742538@qq.com> Date: 星期一, 23 十月 2023 19:25:23 +0800 Subject: [PATCH] 捕获异常判断2007 --- 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