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

Allow worker to actually fail gracefully.

This commit is contained in:
Simo Kinnunen 2014-01-08 11:03:27 +09:00
parent 3f62a51d83
commit 3c647225f3
2 changed files with 25 additions and 9 deletions

View file

@ -6,3 +6,17 @@ assert.ok(process.env.ANDROID_SERIAL,
var log = require('./util/logger')
.setGlobalIdentifier(process.env.ANDROID_SERIAL)
.createLogger('device')
function gracefullyExit() {
process.exit(0)
}
process.on('SIGINT', function() {
gracefullyExit()
})
process.on('SIGTERM', function() {
gracefullyExit()
})
log.info('Started')