mirror of https://github.com/halo-dev/halo
Clear cache before application id destroyed
parent
d7a8723c61
commit
f3e81b9bfb
|
@ -67,8 +67,8 @@ public class InMemoryCacheStore extends StringCacheStore {
|
||||||
|
|
||||||
log.debug("Preparing to put key: [{}], value: [{}]", key, cacheWrapper);
|
log.debug("Preparing to put key: [{}], value: [{}]", key, cacheWrapper);
|
||||||
|
|
||||||
try {
|
|
||||||
lock.lock();
|
lock.lock();
|
||||||
|
try {
|
||||||
// Get the value before
|
// Get the value before
|
||||||
Optional<String> valueOptional = get(key);
|
Optional<String> valueOptional = get(key);
|
||||||
|
|
||||||
|
@ -98,6 +98,11 @@ public class InMemoryCacheStore extends StringCacheStore {
|
||||||
public void preDestroy() {
|
public void preDestroy() {
|
||||||
log.debug("Cancelling all timer tasks");
|
log.debug("Cancelling all timer tasks");
|
||||||
timer.cancel();
|
timer.cancel();
|
||||||
|
clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void clear() {
|
||||||
|
CACHE_CONTAINER.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue