mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 16:13:24 +02:00
Don't try to be clever with cleanup. It's too tricky to get it right.
This commit is contained in:
@@ -56,18 +56,14 @@ module.exports = function(options) {
|
||||
quit.resolve()
|
||||
})
|
||||
|
||||
quit.promise.finally(function() {
|
||||
clearInterval(timer)
|
||||
dbapi.close()
|
||||
.timeout(10000)
|
||||
.then(function() {
|
||||
log.info('Quit after cleanup')
|
||||
})
|
||||
.catch(Promise.TimeoutError, function() {
|
||||
log.error('Cleanup operation timed out, closing unsafely')
|
||||
process.exit(1)
|
||||
})
|
||||
})
|
||||
quit.promise
|
||||
.then(function() {
|
||||
process.exit(0)
|
||||
})
|
||||
.catch(function(err) {
|
||||
log.fatal('Error caused quit: ', err.stack)
|
||||
process.exit(1)
|
||||
})
|
||||
|
||||
log.info('Reaping devices with no heartbeat')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user