aboutsummaryrefslogtreecommitdiffhomepage
path: root/server.js
diff options
context:
space:
mode:
Diffstat (limited to 'server.js')
-rw-r--r--server.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/server.js b/server.js
index fe0cb237a..96c493f29 100644
--- a/server.js
+++ b/server.js
@@ -150,6 +150,18 @@
150 if (err) throw err 150 if (err) throw err
151 // Create/activate the webtorrent module 151 // Create/activate the webtorrent module
152 webtorrent.create(function () { 152 webtorrent.create(function () {
153 function cleanForExit () {
154 utils.cleanForExit(webtorrent.app)
155 }
156
157 function exitGracefullyOnSignal () {
158 process.exit()
159 }
160
161 process.on('exit', cleanForExit)
162 process.on('SIGINT', exitGracefullyOnSignal)
163 process.on('SIGTERM', exitGracefullyOnSignal)
164
153 // ----------- Make the server listening ----------- 165 // ----------- Make the server listening -----------
154 server.listen(port, function () { 166 server.listen(port, function () {
155 videos.seedAll(function () { 167 videos.seedAll(function () {