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

Don't try to be clever with cleanup. It's too tricky to get it right.

This commit is contained in:
Simo Kinnunen 2014-02-25 21:01:21 +09:00
parent 4896ca406e
commit b177d198b3

View file

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