mirror of https://github.com/rclone/rclone.git
fs/cache: unlock mutex in cache.Get to allow recursive calls
This fixes the test lockup in the union tests
This commit is contained in:
parent
d2be792d5e
commit
f3719fe269
|
@ -30,7 +30,9 @@ func Get(fsString string) (f fs.Fs, err error) {
|
||||||
defer fsCacheMu.Unlock()
|
defer fsCacheMu.Unlock()
|
||||||
entry, ok := fsCache[fsString]
|
entry, ok := fsCache[fsString]
|
||||||
if !ok {
|
if !ok {
|
||||||
|
fsCacheMu.Unlock() // Unlock in case Get is called recursively
|
||||||
f, err = fsNewFs(fsString)
|
f, err = fsNewFs(fsString)
|
||||||
|
fsCacheMu.Lock()
|
||||||
if err != nil && err != fs.ErrorIsFile {
|
if err != nil && err != fs.ErrorIsFile {
|
||||||
return f, err
|
return f, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue