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:
parent
4896ca406e
commit
b177d198b3
1 changed files with 8 additions and 12 deletions
|
@ -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')
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue