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

Commit

Permalink
version update includes several fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddias committed Apr 25, 2016
1 parent 45c67e4 commit 7070bca
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"ipfs-multipart": "^0.1.0",
"ipfs-repo": "^0.6.1",
"joi": "^8.0.2",
"libp2p-ipfs": "^0.3.2",
"libp2p-ipfs": "^0.3.3",
"lodash.get": "^4.2.1",
"lodash.set": "^4.0.0",
"multiaddr": "^1.3.0",
Expand Down
13 changes: 10 additions & 3 deletions src/http-api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,15 @@ exports = module.exports = function HttpApi (repo) {
this.stop = (callback) => {
const repoPath = this.ipfs.repo.path()
fs.unlinkSync(path.join(repoPath, 'api'))
this.ipfs.libp2p.stop(() => {
this.server.stop(callback)
})
let counter = 0

this.server.stop(closed)
this.ipfs.libp2p.stop(closed)

function closed () {
if (++counter === 2) {
callback()
}
}
}
}
1 change: 0 additions & 1 deletion test/http-api-tests/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ describe('http api', () => {
after((done) => {
api.stop((err) => {
expect(err).to.not.exist

clean(repoTests)
done()
})
Expand Down
2 changes: 1 addition & 1 deletion test/http-api-tests/test-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ module.exports = (httpAPI) => {
it('updates value for request with both args and JSON flag with valid JSON argument', (done) => {
api.inject({
method: 'POST',
url: '/api/v0/config?arg=Datastore.Path&arg={\"kitten\": true}&json'
url: '/api/v0/config?arg=Datastore.Path&arg={"kitten": true}&json'
}, (res) => {
expect(res.statusCode).to.equal(200)
expect(res.result.Key).to.equal('Datastore.Path')
Expand Down

0 comments on commit 7070bca

Please sign in to comment.