mirror of
https://github.com/lubosz/overte.git
synced 2025-08-08 03:48:38 +02: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) {
|
if (autoShutdown) {
|
||||||
auto pid = qApp->applicationPid();
|
auto pid = qApp->applicationPid();
|
||||||
qCDebug(networking) << "autoShutdown pid is" << pid;
|
args << "--shutdownWith" << QString::number(pid);
|
||||||
args << "--watchProcessShutdown" << QString::number(pid);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (noUpdater) {
|
if (noUpdater) {
|
||||||
|
|
|
@ -890,18 +890,18 @@ function onContentLoaded() {
|
||||||
startInterface();
|
startInterface();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (argv.watchProcessShutdown) {
|
// If we were launched with the shutdownWith option, then we need to shutdown when that process (pid)
|
||||||
let pid = argv.watchProcessShutdown;
|
// is no longer running.
|
||||||
console.log("Watching process: ", pid);
|
if (argv.shutdownWith) {
|
||||||
let watchProcessInterval = setInterval(function() {
|
let pid = argv.shutdownWith;
|
||||||
|
console.log("Shutting down with process: ", pid);
|
||||||
|
let checkProcessInterval = setInterval(function() {
|
||||||
let isRunning = isProcessRunning(pid);
|
let isRunning = isProcessRunning(pid);
|
||||||
if (!isRunning) {
|
if (!isRunning) {
|
||||||
log.debug("Watched process is no longer running, shutting down");
|
log.debug("Watched process is no longer running, shutting down");
|
||||||
clearTimeout(watchProcessInterval);
|
clearTimeout(checkProcessInterval);
|
||||||
forcedShutdown();
|
forcedShutdown();
|
||||||
}
|
}
|
||||||
}, 5000);
|
|
||||||
}
|
|
||||||
|
|
||||||
// If we were launched with the shutdownWatcher option, then we need to watch for the interface app
|
// 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.
|
// shutting down. The interface app will regularly update a running state file which we will check.
|
||||||
|
|
Loading…
Reference in a new issue