mirror of
https://github.com/openstf/stf
synced 2025-10-04 10:19:30 +02:00
Unify socket closers. Don't put them all in one try-catch or some might remain.
This commit is contained in:
parent
f2bcacba00
commit
4ca5230402
5 changed files with 34 additions and 19 deletions
|
@ -394,13 +394,16 @@ module.exports = function(options) {
|
|||
})()
|
||||
|
||||
lifecycle.observe(function() {
|
||||
clearTimeout(totalsTimer)
|
||||
[push, sub].forEach(function(sock) {
|
||||
try {
|
||||
sock.close()
|
||||
}
|
||||
catch (err) {
|
||||
// No-op
|
||||
}
|
||||
})
|
||||
|
||||
try {
|
||||
push.close()
|
||||
sub.close()
|
||||
}
|
||||
catch (err) {}
|
||||
clearTimeout(totalsTimer)
|
||||
|
||||
return Promise.all(Object.keys(workers).map(function(serial) {
|
||||
return workers[serial].cancel()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue