From 0536f8974a820e44961938b78e2e86f26bbd6a6b Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Thu, 1 Jun 2017 18:13:40 -0700 Subject: [PATCH] Remove shutdownWatcher option inside sandbox --- server-console/src/main.js | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/server-console/src/main.js b/server-console/src/main.js index 6667a570c8..46cc472e04 100644 --- a/server-console/src/main.js +++ b/server-console/src/main.js @@ -902,32 +902,6 @@ function onContentLoaded() { clearTimeout(checkProcessInterval); forcedShutdown(); } - - // If we were launched with the shutdownWatcher option, then we need to watch for the interface app - // shutting down. The interface app will regularly update a running state file which we will check. - // If the file doesn't exist or stops updating for a significant amount of time, we will shut down. - if (argv.shutdownWatcher) { - log.debug("Shutdown watcher requested... argv.shutdownWatcher:", argv.shutdownWatcher); - var MAX_TIME_SINCE_EDIT = 5000; // 5 seconds between updates - var firstAttemptToCheck = new Date().getTime(); - var shutdownWatchInterval = setInterval(function(){ - var stats = fs.stat(argv.shutdownWatcher, function(err, stats) { - if (err) { - var sinceFirstCheck = new Date().getTime() - firstAttemptToCheck; - if (sinceFirstCheck > MAX_TIME_SINCE_EDIT) { - log.debug("Running state file is missing, assume interface has shutdown... shutting down snadbox."); - forcedShutdown(); - clearTimeout(shutdownWatchInterval); - } - } else { - var sinceEdit = new Date().getTime() - stats.mtime.getTime(); - if (sinceEdit > MAX_TIME_SINCE_EDIT) { - log.debug("Running state of interface hasn't updated in MAX time... shutting down."); - forcedShutdown(); - clearTimeout(shutdownWatchInterval); - } - } - }); }, 1000); } }