feat[cache]: lazy init SingleCache

This commit is contained in:
godotg committed 2025-02-23 20:43:59 +08:00
1 parent 14e4e55b63
commit b8c0ea04a6
2 files changed
+3 -3

No files matched your search

+2 -2
View File
@@ -21,8 +21,8 @@
```
使用vpn,老版本的是10809端口,新版本的只有一个10809端口
git config --global http.proxy http://127.0.0.1:10808
git config --global https.proxy https://127.0.0.1:10808
git config --global http.proxy http://127.0.0.1:10809
git config --global https.proxy https://127.0.0.1:10809
```
- 换行符
@@ -45,8 +45,8 @@ public class SingleCache<V> {
var cache = new SingleCache<V>();
cache.refreshDuration = refreshDuration;
cache.supplier = supplier;
cache.cache = supplier.get();
cache.refreshTimeAtomic = new AtomicLong(TimeUtils.now() + refreshDuration);
SchedulerBus.execute(() -> cache.cache = supplier.get());
return cache;
}