diff --git a/src/core/components/stop.js b/src/core/components/stop.js index 33e0a4a3c1..d5fb672c84 100644 --- a/src/core/components/stop.js +++ b/src/core/components/stop.js @@ -1,12 +1,17 @@ 'use strict' const series = require('async/series') +const setImmediate = require('async/setImmediate') module.exports = (self) => { return (callback) => { callback = callback || function noop () {} self.log('stop') + if (self.state.state() === 'stopped') { + return callback() + } + const done = (err) => { if (err) { self.emit('error', err)