Skip to content

Commit e6c83dc

Browse files
committed
Merge pull request #44 from ipfs/fix/once
fix: Ensure callbacks are only called once
2 parents 61abc78 + 3a469d5 commit e6c83dc

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
],
3030
"homepage": "https://github.com/ipfs/js-ipfs-repo",
3131
"devDependencies": {
32-
"aegir": "^2.1.0",
32+
"aegir": "^2.1.1",
3333
"async": "^1.5.2",
3434
"bl": "^1.1.2",
3535
"bs58": "^3.0.0",

src/stores/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ exports.setUp = (basePath, blobStore, locks) => {
3131
}
3232

3333
store.createWriteStream('config')
34-
.on('finish', () => {
34+
.once('finish', () => {
3535
locks.unlock(callback)
3636
})
3737
.end(JSON.stringify(config, null, 2))

src/stores/locks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ exports.setUp = (basePath, blobStore) => {
1111
function createLock () {
1212
store
1313
.createWriteStream(lockFile)
14-
.on('finish', () => {
14+
.once('finish', () => {
1515
cb()
1616
})
1717
.end()

src/stores/version.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ exports.setUp = (basePath, blobStore, locks) => {
2828
}
2929

3030
store.createWriteStream('version')
31-
.on('finish', () => {
31+
.once('finish', () => {
3232
locks.unlock(callback)
3333
})
3434
.end(value)

0 commit comments

Comments
 (0)