Skip to content
This repository was archived by the owner on Oct 1, 2021. It is now read-only.

Commit e92d057

Browse files
committed
fix: removing staleness in lock
1 parent 1474d5e commit e92d057

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

src/repo/lock.js

+1-12
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,6 @@ const { lock } = require('proper-lockfile')
77
const log = debug('repo-migrations:repo_fs_lock')
88
const lockFile = 'repo.lock'
99

10-
/**
11-
* Duration in milliseconds in which the lock is considered stale
12-
* @see https://github.com/moxystudio/node-proper-lockfile#lockfile-options
13-
* The default value of 10000 was too low for ipfs and sometimes `proper-lockfile`
14-
* would throw an exception because it couldn't update the lock file mtime within
15-
* the 10s threshold. @see https://github.com/ipfs/js-ipfs-repo/pull/182
16-
* Increasing to 20s is a temporary fix a permanent fix should be implemented in
17-
* the future.
18-
*/
19-
const STALE_TIME = 20000
20-
2110
/**
2211
* Lock the repo in the given dir and given repo's version.
2312
*
@@ -28,7 +17,7 @@ const STALE_TIME = 20000
2817
exports.lock = async (version, dir) => {
2918
const file = path.join(dir, lockFile)
3019
log('locking %s', file)
31-
const release = await lock(dir, { lockfilePath: file, stale: STALE_TIME })
20+
const release = await lock(dir, { lockfilePath: file })
3221
return {
3322
close: () => {
3423
log('releasing lock %s', file)

0 commit comments

Comments
 (0)