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

Commit 663e9f6

Browse files
authored
Merge pull request #889 from ipfs/fix/stop-stopped
fix: succeed when stopping already stopped
2 parents 26477fd + eb49e32 commit 663e9f6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/core/components/stop.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
'use strict'
22

33
const series = require('async/series')
4+
const setImmediate = require('async/setImmediate')
45

56
module.exports = (self) => {
67
return (callback) => {
78
callback = callback || function noop () {}
89
self.log('stop')
910

11+
if (self.state.state() === 'stopped') {
12+
return callback()
13+
}
14+
1015
const done = (err) => {
1116
if (err) {
1217
self.emit('error', err)

0 commit comments

Comments
 (0)