mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 08:13:31 +02:00
Make graceful shutdown more graceful by actually waiting for sockets (and others) to close. Ongoing effort.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
var zmq = require('zmq')
|
||||
|
||||
var logger = require('../util/logger')
|
||||
var lifecycle = require('../util/lifecycle')
|
||||
|
||||
module.exports = function(options) {
|
||||
var log = logger.createLogger('triproxy')
|
||||
@@ -31,4 +32,10 @@ module.exports = function(options) {
|
||||
pull.bindSync(options.endpoints.pull)
|
||||
pull.on('message', proxy(dealer))
|
||||
log.info('PULL socket bound on', options.endpoints.pull)
|
||||
|
||||
lifecycle.observe(function() {
|
||||
pub.close()
|
||||
dealer.close()
|
||||
pull.close()
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user