1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-05 10:39:25 +02:00

Unify socket closers. Don't put them all in one try-catch or some might remain.

This commit is contained in:
Simo Kinnunen 2014-11-17 15:51:57 +09:00
parent f2bcacba00
commit 4ca5230402
5 changed files with 34 additions and 19 deletions

View file

@ -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
}
})
})
}