MCPcopy
hub / github.com/writefreely/writefreely / newUpdatesCache

Function newUpdatesCache

updates.go:98–105  ·  view source on GitHub ↗

newUpdatesCache returns an initialized updates cache

(expiry time.Duration)

Source from the content-addressed store, hash-verified

96
97// newUpdatesCache returns an initialized updates cache
98func newUpdatesCache(expiry time.Duration) *updatesCache {
99 cache := updatesCache{
100 frequency: expiry,
101 currentVersion: "v" + softwareVer,
102 }
103 go cache.CheckNow()
104 return &cache
105}
106
107// InitUpdates initializes the updates cache, if the config value is set
108// It uses the defaultUpdatesCacheTime for the cache expiry

Callers 2

InitUpdatesMethod · 0.85
TestUpdatesRoundTripFunction · 0.85

Calls 1

CheckNowMethod · 0.95

Tested by 1

TestUpdatesRoundTripFunction · 0.68