Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for timeToExpire (0.04 sec)

  1. internal/lru/lru.go

    // in it to expire first.
    func (c *LRU[K, V]) deleteExpired() {
    	c.mu.Lock()
    	bucketIdx := c.nextCleanupBucket
    	timeToExpire := time.Until(c.buckets[bucketIdx].newestEntry)
    	// wait for newest entry to expire before cleanup without holding lock
    	if timeToExpire > 0 {
    		c.mu.Unlock()
    		time.Sleep(timeToExpire)
    		c.mu.Lock()
    	}
    	for _, ent := range c.buckets[bucketIdx].entries {
    		c.removeElement(ent)
    	}
    Registered: Sun Sep 07 09:35:13 UTC 2025
    - Last Modified: Fri Apr 25 08:22:26 UTC 2025
    - 12.5K bytes
    - Viewed (0)
Back to top