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:
parent
3a443402a6
commit
0ae2e7f73c
4 changed files with 33 additions and 9 deletions
12
server.js
12
server.js
|
@ -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 () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue