Customize web app port

This commit is contained in:
Rafostar
2020-12-16 21:15:41 +01:00
parent 84762de76a
commit c1aae76d6e
6 changed files with 16 additions and 23 deletions

View File

@@ -15,31 +15,19 @@ class ClapperWebApp extends Gio.SubprocessLauncher
super._init({ flags });
this.daemonApp = null;
this.isDaemonClosing = false;
}
startDaemonApp()
startDaemonApp(port)
{
if(this.daemonApp)
return;
this.daemonApp = this.spawnv([Misc.appId + '.Daemon']);
this.daemonApp = this.spawnv([Misc.appId + '.Daemon', String(port)]);
this.daemonApp.wait_async(null, this._onDaemonClosed.bind(this));
debug('daemon app started');
}
stopDaemonApp()
{
if(!this.daemonApp || this.isDaemonClosing)
return;
this.isDaemonClosing = true;
this.daemonApp.force_exit();
debug('send stop signal to daemon app');
}
_onDaemonClosed(proc, result)
{
let hadError;
@@ -52,7 +40,6 @@ class ClapperWebApp extends Gio.SubprocessLauncher
}
this.daemonApp = null;
this.isDaemonClosing = false;
if(hadError)
debug('daemon app exited with error or was forced to close');