cache/filecache: Add a filecache root dir

This is just a safe guard to make sure we don't evict/remove files that do not belong to the cache.
This commit is contained in:
Bjørn Erik Pedersen
2018-11-14 11:53:45 +01:00
parent d3489eba5d
commit 33502667fb
5 changed files with 38 additions and 3 deletions

View File

@@ -33,6 +33,7 @@ func TestDecodeConfig(t *testing.T) {
assert := require.New(t)
configStr := `
resourceDir = "myresources"
[caches]
[caches.getJSON]
maxAge = "10m"
@@ -72,6 +73,7 @@ func TestDecodeConfigIgnoreCache(t *testing.T) {
assert := require.New(t)
configStr := `
resourceDir = "myresources"
ignoreCache = true
[caches]
[caches.getJSON]