about summary refs log tree commit diff
path: root/streaming/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'streaming/index.js')
-rw-r--r--streaming/index.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/streaming/index.js b/streaming/index.js
index 8395c9cf8..c7959b306 100644
--- a/streaming/index.js
+++ b/streaming/index.js
@@ -328,6 +328,14 @@ if (cluster.isMaster) {
 
   server.listen(process.env.PORT || 4000, () => {
     log.level = process.env.LOG_LEVEL || 'verbose'
-    log.info(`Starting streaming API server worker on port ${server.address().port}`)
+    log.info(`Starting streaming API server worker on ${server.address()}`)
   })
+
+  process.on('SIGINT', exit)
+  process.on('SIGTERM', exit)
+  process.on('exit', exit)
+
+  function exit() {
+    server.close()
+  }
 }