diff --git a/lib/roles/reaper.js b/lib/roles/reaper.js index 11cdfead..1f0acf25 100644 --- a/lib/roles/reaper.js +++ b/lib/roles/reaper.js @@ -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') }