From 59f783bfb7188c0b1032b8dfb27dd929a6d8355a Mon Sep 17 00:00:00 2001 From: iacker Date: Wed, 1 Feb 2023 09:36:20 +0800 Subject: [PATCH] Update LocalCache.java MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix: 优化代码 --- .../src/main/java/com/lark/oapi/core/cache/LocalCache.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/larksuite-oapi/src/main/java/com/lark/oapi/core/cache/LocalCache.java b/larksuite-oapi/src/main/java/com/lark/oapi/core/cache/LocalCache.java index 103bfa60f..8b9eecdc4 100644 --- a/larksuite-oapi/src/main/java/com/lark/oapi/core/cache/LocalCache.java +++ b/larksuite-oapi/src/main/java/com/lark/oapi/core/cache/LocalCache.java @@ -35,12 +35,12 @@ public static LocalCache getInstance() { @Override public String get(String key) { - Value v = this.CACHE.get(key); + Value v = CACHE.get(key); if (v == null || new Date().after(v.end)) { return ""; } - log.debug("get key:{},time left:{}s", key, (v.end.getTime() - new Date().getTime()) / 1000); + log.debug("get key:{},time left:{}s", key, (v.end.getTime() - System.currentTimeMillis()) / 1000); return v.value; }