- Sort Score
- Result 10 results
- Languages All
Results 1 - 1 of 1 for UnixMilli (0.29 sec)
-
internal/cachevalue/cache.go
// Tf the Update function returns an error the value is forwarded as is and not cached. func (t *Cache[T]) Get() (T, error) { v := t.valErr.Load() ttl := t.ttl vTime := t.lastUpdateMs.Load() tNow := time.Now().UnixMilli() if v != nil && tNow-vTime < ttl.Milliseconds() { if v.e == nil { return v.v, nil } if v.e != nil && t.opts.CacheError || t.opts.ReturnLastGood { return v.v, v.e } }
Go - Registered: Sun May 05 19:28:20 GMT 2024 - Last Modified: Fri Mar 01 16:00:42 GMT 2024 - 4.2K bytes - Viewed (0)