From e92d0572fd123fd57bd61e5324fddb6b6b38c68c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Uhl=C3=AD=C5=99?= Date: Tue, 22 Oct 2019 12:13:50 +0200 Subject: [PATCH] fix: removing staleness in lock --- src/repo/lock.js | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/repo/lock.js b/src/repo/lock.js index 19d0829..37e2744 100644 --- a/src/repo/lock.js +++ b/src/repo/lock.js @@ -7,17 +7,6 @@ const { lock } = require('proper-lockfile') const log = debug('repo-migrations:repo_fs_lock') const lockFile = 'repo.lock' -/** - * Duration in milliseconds in which the lock is considered stale - * @see https://github.com/moxystudio/node-proper-lockfile#lockfile-options - * The default value of 10000 was too low for ipfs and sometimes `proper-lockfile` - * would throw an exception because it couldn't update the lock file mtime within - * the 10s threshold. @see https://github.com/ipfs/js-ipfs-repo/pull/182 - * Increasing to 20s is a temporary fix a permanent fix should be implemented in - * the future. - */ -const STALE_TIME = 20000 - /** * Lock the repo in the given dir and given repo's version. * @@ -28,7 +17,7 @@ const STALE_TIME = 20000 exports.lock = async (version, dir) => { const file = path.join(dir, lockFile) log('locking %s', file) - const release = await lock(dir, { lockfilePath: file, stale: STALE_TIME }) + const release = await lock(dir, { lockfilePath: file }) return { close: () => { log('releasing lock %s', file)