MCPcopy
hub / github.com/restic/restic / IsOld

Function IsOld

internal/backend/cache/cache.go:234–237  ·  view source on GitHub ↗

IsOld returns true if the timestamp is considered old.

(t time.Time, maxAge time.Duration)

Source from the content-addressed store, hash-verified

232
233// IsOld returns true if the timestamp is considered old.
234func IsOld(t time.Time, maxAge time.Duration) bool {
235 oldest := time.Now().Add(-maxAge)
236 return t.Before(oldest)
237}
238
239// Wrap returns a backend with a cache.
240func (c *Cache) Wrap(be backend.Backend, errorLog func(string, ...interface{})) backend.Backend {

Callers 2

runCacheFunction · 0.92
OlderThanFunction · 0.85

Calls 2

NowMethod · 0.80
AddMethod · 0.45

Tested by

no test coverage detected