Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for Unlock (0.2 sec)

  1. internal/cachevalue/cache.go

    		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.
    		v = t.valErr.Load()
    		t.updating.Unlock()
    		return v.v, v.e
    	}
    	t.update()
    	v = t.valErr.Load()
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Fri Mar 01 16:00:42 GMT 2024
    - 4.2K bytes
    - Viewed (0)
  2. internal/config/cache/cache.go

    func (c Config) MatchesSize(size int64) bool {
    	configLock.RLock()
    	defer configLock.RUnlock()
    
    	return c.Enable && c.BlockSize > 0 && size <= c.BlockSize
    }
    
    // Update updates new cache frequency
    func (c *Config) Update(ncfg Config) {
    	configLock.Lock()
    	defer configLock.Unlock()
    
    	c.Enable = ncfg.Enable
    	c.Endpoint = ncfg.Endpoint
    	c.BlockSize = ncfg.BlockSize
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Jan 18 07:03:17 GMT 2024
    - 5.6K bytes
    - Viewed (0)
Back to top