fix[cache]: sync refresh cache to avoid getting a old value after long time

This commit is contained in:
godotg
2023-08-13 18:05:08 +08:00
parent 4513db8bed
commit 54516dd531
@@ -61,7 +61,7 @@ public class SingleCache<V> {
try {
if (now > refreshTime) {
refreshTime = now + refreshDuration;
EventBus.asyncExecute(() -> cache = supplier.get());
cache = supplier.get();
}
} finally {
lock.unlock();