/
githubmirror
/
pm2
Обзор
Документация
Войти
/
githubmirror
/
pm2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
examples/misc-examples/graceful-exit.js
25 строк
488 B
vince
refactor: drop gracefullreload
28 фев 2018, 20:39
28 фев 2018, 20:39
bb57c76
Код
Авторство
О чём код?
/* * Example of graceful exit * * $ pm2 reload all */ process.on('message', function(msg) { if (msg == 'shutdown') { console.log('Closing all connections...'); setTimeout(function() { console.log('Finished closing connections'); process.exit(0); }, 1500); } }); var http = require('http'); http.createServer(function(req, res) { res.writeHead(200); console.log('got'); res.end('hey'); }).listen(8000, function() { console.log('listening'); });