1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 19:42:24 +02:00

add robustness when we run the electron process and move the exit

controller inside the main js file
This commit is contained in:
Chocobozzz 2015-11-02 22:19:39 +01:00
parent 3a443402a6
commit 0ae2e7f73c
4 changed files with 33 additions and 9 deletions

View file

@ -150,6 +150,18 @@
if (err) throw err
// Create/activate the webtorrent module
webtorrent.create(function () {
function cleanForExit () {
utils.cleanForExit(webtorrent.app)
}
function exitGracefullyOnSignal () {
process.exit()
}
process.on('exit', cleanForExit)
process.on('SIGINT', exitGracefullyOnSignal)
process.on('SIGTERM', exitGracefullyOnSignal)
// ----------- Make the server listening -----------
server.listen(port, function () {
videos.seedAll(function () {