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.
Tommi Virtanen committed
Mar 13, 2015 at 14:38 UTC
215fed1051d1e5527c9b544cf175910a47e2cff0
1 file changed
+3
-4
repo/fsrepo/fsrepo.go
+3
-4
@@ -172,12 +172,11 @@ func Remove(repoPath string) error {
172
func LockedByOtherProcess(repoPath string) bool {
173
repoPath = path.Clean(repoPath)
174
175
- // packageLock must be held to check the number of openers.
176
- packageLock.Lock()
177
- defer packageLock.Unlock()
175
+ // TODO replace this with the "api" file
176
+ // https://github.com/ipfs/specs/tree/master/repo/fs-repo
177
178
// NB: the lock is only held when repos are Open
180
- return lockfile.Locked(repoPath) && openersCounter.NumOpeners(repoPath) == 0
179
+ return lockfile.Locked(repoPath)
180
}
181
182
// openConfig returns an error if the config file is not present.