|
|
@ -288,10 +288,10 @@ func stopJanitor(c *Cache) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Returns a new cache with a given default expiration duration and default cleanup
|
|
|
|
// Returns a new cache with a given default expiration duration and default cleanup
|
|
|
|
// interval. If the expiration duration is less than 1, the items in the cache never expire
|
|
|
|
// interval. If the expiration duration is less than 1, the items in the cache never
|
|
|
|
// and have to be deleted manually. If the cleanup interval is less than one, expired
|
|
|
|
// expire and must be deleted manually. If the cleanup interval is less than one,
|
|
|
|
// items are not deleted from the cache before their next lookup or before calling
|
|
|
|
// expired items are not deleted from the cache before their next lookup or before
|
|
|
|
// DeleteExpired.
|
|
|
|
// calling DeleteExpired.
|
|
|
|
func New(de, ci time.Duration) *Cache {
|
|
|
|
func New(de, ci time.Duration) *Cache {
|
|
|
|
if de == 0 {
|
|
|
|
if de == 0 {
|
|
|
|
de = -1
|
|
|
|
de = -1
|
|
|
|