lib/model: Correct handling of fakefs cache

We looked under one cache key, then stored under another...
This commit is contained in:
Jakob Borg 2021-11-17 11:42:20 +01:00
parent 591e4d8af1
commit f1bf4d899a
1 changed files with 1 additions and 3 deletions

View File

@ -89,11 +89,9 @@ func newFakeFilesystem(rootURI string, _ ...Option) *fakeFS {
fakeFSMut.Lock()
defer fakeFSMut.Unlock()
root := rootURI
var params url.Values
uri, err := url.Parse(rootURI)
if err == nil {
root = uri.Path
params = uri.Query()
}
@ -157,7 +155,7 @@ func newFakeFilesystem(rootURI string, _ ...Option) *fakeFS {
// the filesystem initially.
fs.latency, _ = time.ParseDuration(params.Get("latency"))
fakeFSCache[root] = fs
fakeFSCache[rootURI] = fs
return fs
}