Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
Merge pull request #889 from ipfs/fix/stop-stopped
Browse files Browse the repository at this point in the history
fix: succeed when stopping already stopped
  • Loading branch information
daviddias authored Jun 30, 2017
2 parents 26477fd + eb49e32 commit 663e9f6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/core/components/stop.js
Original file line number Diff line number Diff line change
@@ -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)
Expand Down

0 comments on commit 663e9f6

Please sign in to comment.