We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b030cd4 commit 6ed842eCopy full SHA for 6ed842e
1 file changed
caching/src/main/java/com/iluwatar/caching/AppManager.java
@@ -64,12 +64,7 @@ public static void initDb(boolean useMongoDb) {
64
public static void initCachingPolicy(CachingPolicy policy) {
65
cachingPolicy = policy;
66
if (cachingPolicy == CachingPolicy.BEHIND) {
67
- Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
68
- @Override
69
- public void run() {
70
- CacheStore.flushCache();
71
- }
72
- }));
+ Runtime.getRuntime().addShutdownHook(new Thread(CacheStore::flushCache));
73
}
74
CacheStore.clearCache();
75
0 commit comments