mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-20 00:53:26 +02:00
Unify socket closers. Don't put them all in one try-catch or some might remain.
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user