Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for UnixMilli (0.42 sec)

  1. 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)
Back to top