From cfc7cf33e23660efe4e48daa553fc9c2680401ef Mon Sep 17 00:00:00 2001 From: Eugene Livis Date: Wed, 8 Jul 2015 13:29:05 -0400 Subject: [PATCH] Synchronization for status setting, immediate execution of first services check --- Core/src/org/sleuthkit/autopsy/core/ServicesMonitor.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/core/ServicesMonitor.java b/Core/src/org/sleuthkit/autopsy/core/ServicesMonitor.java index 567711fcde..4f88c0f916 100644 --- a/Core/src/org/sleuthkit/autopsy/core/ServicesMonitor.java +++ b/Core/src/org/sleuthkit/autopsy/core/ServicesMonitor.java @@ -127,10 +127,10 @@ public class ServicesMonitor { /** * Start periodic task that check the availability of key collaboration - * services. + * services. First check is triggered immediately. */ periodicTasksExecutor = new ScheduledThreadPoolExecutor(NUMBER_OF_PERIODIC_TASK_THREADS, new ThreadFactoryBuilder().setNameFormat(PERIODIC_TASK_THREAD_NAME).build()); - periodicTasksExecutor.scheduleAtFixedRate(new CrashDetectionTask(), CRASH_DETECTION_INTERVAL_MINUTES, CRASH_DETECTION_INTERVAL_MINUTES, TimeUnit.MINUTES); + periodicTasksExecutor.scheduleAtFixedRate(new CrashDetectionTask(), 0, CRASH_DETECTION_INTERVAL_MINUTES, TimeUnit.MINUTES); } /** @@ -140,7 +140,7 @@ public class ServicesMonitor { * @param service Name of the service. * @param status Updated status for the service. */ - private void setServiceStatus(String service, String status) { + private synchronized void setServiceStatus(String service, String status) { // verify that status has changed if (status.equals(statusByService.get(service))) {