diff --git a/src/main/java/it/finanze/sanita/fse2/ms/edsclient/service/impl/ConfigSRV.java b/src/main/java/it/finanze/sanita/fse2/ms/edsclient/service/impl/ConfigSRV.java index 2478d73..6c311f4 100644 --- a/src/main/java/it/finanze/sanita/fse2/ms/edsclient/service/impl/ConfigSRV.java +++ b/src/main/java/it/finanze/sanita/fse2/ms/edsclient/service/impl/ConfigSRV.java @@ -51,7 +51,7 @@ public void postConstruct() { public Boolean isRemoveMetadataEnable() { long lastUpdate = props.get(PROPS_NAME_REMOVE_METADATA_ENABLE).getKey(); if (new Date().getTime() - lastUpdate >= DELTA_MS) { - synchronized(ConfigSRV.class) { + synchronized(Locks.REMOVE_METADATA_ENABLE) { if (new Date().getTime() - lastUpdate >= DELTA_MS) { refresh(PROPS_NAME_REMOVE_METADATA_ENABLE); } @@ -94,4 +94,8 @@ private void init() { integrity(); } + private static final class Locks { + public static final Object REMOVE_METADATA_ENABLE = new Object(); + } + }