SetExpireInterval sets the interval at which the cache expiry runs Set to 0 or a -ve number to disable
(d time.Duration)
| 47 | // |
| 48 | // Set to 0 or a -ve number to disable |
| 49 | func (c *Cache) SetExpireInterval(d time.Duration) *Cache { |
| 50 | if d <= 0 { |
| 51 | d = 100 * 365 * 24 * time.Hour |
| 52 | } |
| 53 | c.expireInterval = d |
| 54 | return c |
| 55 | } |
| 56 | |
| 57 | // cacheEntry is stored in the cache |
| 58 | type cacheEntry struct { |
no outgoing calls