mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-19 00:23:25 +02:00
Make graceful shutdown more graceful by actually waiting for sockets (and others) to close. Ongoing effort.
This commit is contained in:
@@ -8,6 +8,7 @@ var logger = require('../../util/logger')
|
||||
var wire = require('../../wire')
|
||||
var wirerouter = require('../../wire/router')
|
||||
var wireutil = require('../../wire/util')
|
||||
var lifecycle = require('../../util/lifecycle')
|
||||
|
||||
module.exports = function(options) {
|
||||
var log = logger.createLogger('notify-hipchat')
|
||||
@@ -61,18 +62,10 @@ module.exports = function(options) {
|
||||
})
|
||||
}
|
||||
|
||||
function gracefullyExit() {
|
||||
process.exit(0)
|
||||
}
|
||||
|
||||
process.on('SIGINT', function() {
|
||||
gracefullyExit()
|
||||
})
|
||||
|
||||
process.on('SIGTERM', function() {
|
||||
gracefullyExit()
|
||||
})
|
||||
|
||||
log.info('Listening for %s (or higher) level log messages',
|
||||
logger.LevelLabel[options.priority])
|
||||
|
||||
lifecycle.observe(function() {
|
||||
sub.close()
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user