Skip to content

Commit

Permalink
Merge pull request #74 from woehrl01/clear_cache_restart
Browse files Browse the repository at this point in the history
0003541: Clear caches on a restart of the server
  • Loading branch information
mmichalek committed May 16, 2018
2 parents 32bee36 + 75fda65 commit 5f7276b
Showing 1 changed file with 15 additions and 0 deletions.
Expand Up @@ -634,6 +634,8 @@ public synchronized boolean start() {
return start(true);
}

private boolean isFirstStart = true;

public synchronized boolean start(boolean startJobs) {
isInitialized = false;
if (!starting && !started) {
Expand Down Expand Up @@ -703,6 +705,12 @@ public synchronized boolean start(boolean startJobs) {
if (parameterService.isRegistrationServer()) {
this.updateService.init();
}

if(isFirstStart){
isFirstStart = false;
}else{
this.clearCaches();
}

lastRestartTime = new Date();
statisticManager.incrementRestart();
Expand Down Expand Up @@ -990,14 +998,21 @@ public void openRegistration(String nodeGroupId, String externalId) {
}

public void clearCaches() {
getExtensionService().refresh();
getTriggerRouterService().clearCache();
getParameterService().rereadParameters();
getTransformService().clearCache();
getDataLoaderService().clearCache();
getConfigurationService().initDefaultChannels();
getConfigurationService().clearCache();
getNodeService().flushNodeAuthorizedCache();
getNodeService().flushNodeCache();
getNodeService().flushNodeGroupCache();
getJobManager().startJobsAfterConfigChange();
getLoadFilterService().clearCache();
getMonitorService().flushMonitorCache();
getMonitorService().flushNotificationCache();
getFileSyncService().clearCache();
}

public void reOpenRegistration(String nodeId) {
Expand Down

0 comments on commit 5f7276b

Please sign in to comment.