mirror of
https://github.com/openstf/stf
synced 2025-10-04 18:29:17 +02:00
Don't freak out if trying to close a socket that was already closed.
This commit is contained in:
parent
c9043dd895
commit
71bf2fd131
4 changed files with 21 additions and 8 deletions
|
@ -97,7 +97,10 @@ module.exports = function(options) {
|
||||||
.handler())
|
.handler())
|
||||||
|
|
||||||
lifecycle.observe(function() {
|
lifecycle.observe(function() {
|
||||||
appDealer.close()
|
try {
|
||||||
devDealer.close()
|
appDealer.close()
|
||||||
|
devDealer.close()
|
||||||
|
}
|
||||||
|
catch (err) {}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -365,8 +365,11 @@ module.exports = function(options) {
|
||||||
lifecycle.observe(function() {
|
lifecycle.observe(function() {
|
||||||
clearTimeout(totalsTimer)
|
clearTimeout(totalsTimer)
|
||||||
|
|
||||||
push.close()
|
try {
|
||||||
sub.close()
|
push.close()
|
||||||
|
sub.close()
|
||||||
|
}
|
||||||
|
catch (err) {}
|
||||||
|
|
||||||
return Promise.all(Object.keys(workers).map(function(serial) {
|
return Promise.all(Object.keys(workers).map(function(serial) {
|
||||||
return workers[serial].cancel()
|
return workers[serial].cancel()
|
||||||
|
|
|
@ -49,6 +49,10 @@ module.exports = function(options) {
|
||||||
|
|
||||||
lifecycle.observe(function() {
|
lifecycle.observe(function() {
|
||||||
clearTimeout(timer)
|
clearTimeout(timer)
|
||||||
push.close()
|
|
||||||
|
try {
|
||||||
|
push.close()
|
||||||
|
}
|
||||||
|
catch (err) {}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,8 +34,11 @@ module.exports = function(options) {
|
||||||
log.info('PULL socket bound on', options.endpoints.pull)
|
log.info('PULL socket bound on', options.endpoints.pull)
|
||||||
|
|
||||||
lifecycle.observe(function() {
|
lifecycle.observe(function() {
|
||||||
pub.close()
|
try {
|
||||||
dealer.close()
|
pub.close()
|
||||||
pull.close()
|
dealer.close()
|
||||||
|
pull.close()
|
||||||
|
}
|
||||||
|
catch (err) {}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue