lib/model: Correct handling of fakefs cache
We looked under one cache key, then stored under another...
This commit is contained in:
+1
-3
@@ -89,11 +89,9 @@ func newFakeFilesystem(rootURI string, _ ...Option) *fakeFS {
|
|||||||
fakeFSMut.Lock()
|
fakeFSMut.Lock()
|
||||||
defer fakeFSMut.Unlock()
|
defer fakeFSMut.Unlock()
|
||||||
|
|
||||||
root := rootURI
|
|
||||||
var params url.Values
|
var params url.Values
|
||||||
uri, err := url.Parse(rootURI)
|
uri, err := url.Parse(rootURI)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
root = uri.Path
|
|
||||||
params = uri.Query()
|
params = uri.Query()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -157,7 +155,7 @@ func newFakeFilesystem(rootURI string, _ ...Option) *fakeFS {
|
|||||||
// the filesystem initially.
|
// the filesystem initially.
|
||||||
fs.latency, _ = time.ParseDuration(params.Get("latency"))
|
fs.latency, _ = time.ParseDuration(params.Get("latency"))
|
||||||
|
|
||||||
fakeFSCache[root] = fs
|
fakeFSCache[rootURI] = fs
|
||||||
return fs
|
return fs
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user