Skip to content

Commit

Permalink
chore: do not call shutdown twice
Browse files Browse the repository at this point in the history
The interface tests in ipfs-inactive/js-ipfs-http-client#1183 have started throwing `UnhandledPromiseRejection`s for a connection refused error to `/api/v0/shutdown`. This is because `stop` was being called and then called again in `killProcess`.

With callbacks this error was smothered but it is now appearing with the promise-only API.
  • Loading branch information
Alan Shaw authored Dec 3, 2019
1 parent 096baa4 commit b37ebcc
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/ipfsd-daemon.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,7 @@ class Daemon {
if (!this.subprocess) {
return this
}
await this.api.stop()
// TODO this should call this.api.stop

await this.killProcess(timeout)

if (this.disposable) {
Expand Down

0 comments on commit b37ebcc

Please sign in to comment.