mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-10-13 12:15:15 +00:00
feat[cache]: lazy init SingleCache
This commit is contained in:
1 parent
14e4e55b63
commit
b8c0ea04a6
2 files changed
+3
-3
No files matched your search
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user