mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 04:53:19 +02:00
Unify socket closers. Don't put them all in one try-catch or some might remain.
This commit is contained in:
@@ -34,11 +34,13 @@ module.exports = function(options) {
|
||||
log.info('PULL socket bound on', options.endpoints.pull)
|
||||
|
||||
lifecycle.observe(function() {
|
||||
try {
|
||||
pub.close()
|
||||
dealer.close()
|
||||
pull.close()
|
||||
}
|
||||
catch (err) {}
|
||||
[pub, dealer, pull].forEach(function(sock) {
|
||||
try {
|
||||
sock.close()
|
||||
}
|
||||
catch (err) {
|
||||
// No-op
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user