process.on 으로 시그널 핸들러를 연결해두는 듯
var cluster = require('cluster'); console.log('started master with ' + process.pid); //fork the first process cluster.fork(); process.on('SIGHUP', function () { console.log('Reloading...'); var new_worker = cluster.fork(); new_worker.once('listening', function () { //stop all other workers for(var id in cluster.workers) { if (id === new_worker.id.toString()) continue; cluster.workers[id].kill('SIGTERM'); } }); }); |
[링크 : https://joseoncode.com/2015/01/18/reloading-node-with-no-downtime/]
[링크 : http://zguide.zeromq.org/js:interrupt]
[링크 : https://stackoverflow.com/questions/20165605/detecting-ctrlc-in-node-js]
'Programming > node.js' 카테고리의 다른 글
node.js 항목 확인 (0) | 2019.04.23 |
---|---|
proxy error: Error: write after end (0) | 2019.04.23 |
nodejs url param delete (0) | 2019.04.17 |
url 끝의 / (0) | 2019.04.17 |
js array key 삭제하기 (0) | 2019.04.16 |