+
+ const onPeerTubeExit = () => rej(new Error('Process exited'))
+ const onParentExit = () => {
+ if (!this.app || !this.app.pid) return
+
+ try {
+ process.kill(self.app.pid)
+ } catch { /* empty */ }
+ }
+
+ this.app.on('exit', onPeerTubeExit)
+ process.on('exit', onParentExit)
+