Rename watchProcessShutdown to shutdownWith

This commit is contained in:
Ryan Huffman 2017-06-01 18:13:27 -07:00
parent 52f9100332
commit aa48f3f063
2 changed files with 8 additions and 9 deletions

View file

@ -74,8 +74,7 @@ void runLocalSandbox(QString contentPath, bool autoShutdown, bool noUpdater) {
if (autoShutdown) {
auto pid = qApp->applicationPid();
qCDebug(networking) << "autoShutdown pid is" << pid;
args << "--watchProcessShutdown" << QString::number(pid);
args << "--shutdownWith" << QString::number(pid);
}
if (noUpdater) {

View file

@ -890,18 +890,18 @@ function onContentLoaded() {
startInterface();
}
if (argv.watchProcessShutdown) {
let pid = argv.watchProcessShutdown;
console.log("Watching process: ", pid);
let watchProcessInterval = setInterval(function() {
// If we were launched with the shutdownWith option, then we need to shutdown when that process (pid)
// is no longer running.
if (argv.shutdownWith) {
let pid = argv.shutdownWith;
console.log("Shutting down with process: ", pid);
let checkProcessInterval = setInterval(function() {
let isRunning = isProcessRunning(pid);
if (!isRunning) {
log.debug("Watched process is no longer running, shutting down");
clearTimeout(watchProcessInterval);
clearTimeout(checkProcessInterval);
forcedShutdown();
}
}, 5000);
}
// 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.