mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Rename watchProcessShutdown to shutdownWith
This commit is contained in:
parent
52f9100332
commit
aa48f3f063
2 changed files with 8 additions and 9 deletions
|
@ -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) {
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue