newUpdatesCache returns an initialized updates cache
(expiry time.Duration)
| 96 | |
| 97 | // newUpdatesCache returns an initialized updates cache |
| 98 | func 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 |