diff options
| author | Aya Morisawa <AyaMorisawa4869@gmail.com> | 2018-07-14 00:39:39 +0900 |
|---|---|---|
| committer | Aya Morisawa <AyaMorisawa4869@gmail.com> | 2018-07-14 00:39:39 +0900 |
| commit | 5e788f0da48a13dae08b09ca8156a92f0884795d (patch) | |
| tree | 36dd531c332cc44c842b2f36025d110cfc5f3546 /src | |
| parent | Update log message (diff) | |
| download | sharkey-5e788f0da48a13dae08b09ca8156a92f0884795d.tar.gz sharkey-5e788f0da48a13dae08b09ca8156a92f0884795d.tar.bz2 sharkey-5e788f0da48a13dae08b09ca8156a92f0884795d.zip | |
Kill child process on exit
Diffstat (limited to 'src')
| -rw-r--r-- | src/daemons/notes-stats.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/daemons/notes-stats.ts b/src/daemons/notes-stats.ts index 021e6d64a7..54ce746de2 100644 --- a/src/daemons/notes-stats.ts +++ b/src/daemons/notes-stats.ts @@ -3,7 +3,7 @@ import Xev from 'xev'; const ev = new Xev(); -export default function() { +export default function () { const log: any[] = []; const p = childProcess.fork(__dirname + '/notes-stats-child.js'); @@ -17,4 +17,9 @@ export default function() { ev.on('requestNotesStatsLog', id => { ev.emit('notesStatsLog:' + id, log); }); + + process.on('exit', code => { + process.kill(p.pid); + }); + } |