From 0372337e09c72921ff32241caad95b7c990eddeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=B1=E6=9C=88=20=E9=9B=B6?= Date: Thu, 5 Jul 2018 18:34:01 +0900 Subject: [PATCH] catch SIGINT so we can Ctrl+C to close camera.js on the terminal --- camera.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/camera.js b/camera.js index fc3c331c..dbc8317c 100644 --- a/camera.js +++ b/camera.js @@ -13,6 +13,9 @@ process.on('uncaughtException', function (err) { console.error('Uncaught Exception occured!'); console.error(err.stack); }); +process.on('SIGINT', function() { + process.exit(); +}); var staticFFmpeg = false; try{ staticFFmpeg = require('ffmpeg-static').path; @@ -6751,4 +6754,4 @@ if(config.childNodes.mode === 'child'){ } }) },1500) -} \ No newline at end of file +}