mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-12 05:35:31 +00:00
bug4561: using the foreground executor for invalidating the ShortTimeWindCache
This commit is contained in:
1 parent
20d24a7bec
commit
d2169affb9
1 file changed
+8
-2
+8
-2
@@ -110,11 +110,17 @@ public class ShortTimeWindCache {
|
||||
}
|
||||
|
||||
/**
|
||||
* Must be called while owning the {@link #order} monitor (synchronized)
|
||||
* Must be called while owning the {@link #order} monitor (synchronized).
|
||||
* The task of cleaning the caches is so short and on the other hand so
|
||||
* important, especially during server start-up, that it shouldn't have to
|
||||
* compete with millions of other background tasks (as they are generated
|
||||
* during a system start-up) but rather should execute timely, according
|
||||
* to schedule. That's why we schedule them with the default foreground
|
||||
* executor.
|
||||
*/
|
||||
private void ensureTimerIsRunning() {
|
||||
if (invalidatorHandle == null) {
|
||||
invalidatorHandle = ThreadPoolUtil.INSTANCE.getDefaultBackgroundTaskThreadPoolExecutor().
|
||||
invalidatorHandle = ThreadPoolUtil.INSTANCE.getDefaultForegroundTaskThreadPoolExecutor().
|
||||
scheduleAtFixedRate(new CacheInvalidator(), /* delay */ preserveHowManyMilliseconds, preserveHowManyMilliseconds, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user