Commit 215fed10 authored by Tommi Virtanen's avatar Tommi Virtanen

fsrepo.LockedByOtherProcess no longer checks for local opens

This is only called from `ipfs` command line tool well before it opens
the repo. The behavior change here causes a false positive if the
current process has already opened the repo. That's a bit late to ask
this question, anyway, and is not expected to have ever triggered.
parent e0bee137
......@@ -172,12 +172,11 @@ func Remove(repoPath string) error {
func LockedByOtherProcess(repoPath string) bool {
repoPath = path.Clean(repoPath)
// packageLock must be held to check the number of openers.
packageLock.Lock()
defer packageLock.Unlock()
// TODO replace this with the "api" file
// https://github.com/ipfs/specs/tree/master/repo/fs-repo
// NB: the lock is only held when repos are Open
return lockfile.Locked(repoPath) && openersCounter.NumOpeners(repoPath) == 0
return lockfile.Locked(repoPath)
}
// openConfig returns an error if the config file is not present.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment