Skip to content

Commit

Permalink
feat(server): Wait for server to exit when stopping it
Browse files Browse the repository at this point in the history
  • Loading branch information
gustaff-weldon committed Nov 23, 2021
1 parent 693dc2c commit 6474165
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,12 @@ function waitAndRun ({ start, url, runFn }) {
})
.then(() => {
debug('stopping server')
server.kill()
return new Promise((resolve, reject) => {
server.kill('SIGINT', { forceKillAfterTimeout: 10000 })
server.on('exit', () => {
resolve()
})
})
})
}
}
Expand Down

0 comments on commit 6474165

Please sign in to comment.