- Sort Score
- Result 10 results
- Languages All
Results 1 - 1 of 1 for updating (0.35 sec)
-
internal/cachevalue/cache.go
if t.opts.NoWait && v != nil && tNow-vTime < ttl.Milliseconds()*2 && (v.e == nil || t.opts.CacheError) { if t.updating.TryLock() { go func() { defer t.updating.Unlock() t.update() }() } return v.v, v.e } // Get lock. Either we get it or we wait for it. t.updating.Lock() if time.Since(time.UnixMilli(t.lastUpdateMs.Load())) < ttl { // There is a new value, release lock and return it.
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)