aboutsummaryrefslogtreecommitdiff
path: root/lib/ignore/cache.go
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ignore/cache.go')
-rw-r--r--lib/ignore/cache.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/ignore/cache.go b/lib/ignore/cache.go
index 5028f6575..e169c1b47 100644
--- a/lib/ignore/cache.go
+++ b/lib/ignore/cache.go
@@ -6,7 +6,11 @@
package ignore
-import "time"
+import (
+ "time"
+
+ "github.com/syncthing/syncthing/lib/ignore/ignoreresult"
+)
type nower interface {
Now() time.Time
@@ -20,7 +24,7 @@ type cache struct {
}
type cacheEntry struct {
- result Result
+ result ignoreresult.R
access int64 // Unix nanosecond count. Sufficient until the year 2262.
}
@@ -39,7 +43,7 @@ func (c *cache) clean(d time.Duration) {
}
}
-func (c *cache) get(key string) (Result, bool) {
+func (c *cache) get(key string) (ignoreresult.R, bool) {
entry, ok := c.entries[key]
if ok {
entry.access = clock.Now().UnixNano()
@@ -48,7 +52,7 @@ func (c *cache) get(key string) (Result, bool) {
return entry.result, ok
}
-func (c *cache) set(key string, result Result) {
+func (c *cache) set(key string, result ignoreresult.R) {
c.entries[key] = cacheEntry{result, time.Now().UnixNano()}
}