Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for worthKeeping (0.18 sec)

  1. cmd/metacache.go

    	recursive    bool       `msg:"rec"`
    	dataVersion  uint8      `msg:"v"`
    }
    
    func (m *metacache) finished() bool {
    	return !m.ended.IsZero()
    }
    
    // worthKeeping indicates if the cache by itself is worth keeping.
    func (m *metacache) worthKeeping() bool {
    	if m == nil {
    		return false
    	}
    	cache := m
    	switch {
    	case !cache.finished() && time.Since(cache.lastUpdate) > metacacheMaxRunningAge:
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 5K bytes
    - Viewed (0)
  2. cmd/metacache_test.go

    			} else {
    				want = wantResults[i]
    			}
    
    			got := tt.finished()
    			if got != want {
    				t.Errorf("#%d: want %v, got %v", i, want, got)
    			}
    		})
    	}
    }
    
    func Test_metacache_worthKeeping(t *testing.T) {
    	// TODO: Update...
    	wantResults := []bool{0: true, 1: true, 2: true, 3: false, 4: false, 5: true, 6: true, 7: false, 8: false}
    
    	for i, tt := range metaCacheTestset {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Wed Sep 08 18:06:45 GMT 2021
    - 6.8K bytes
    - Viewed (0)
  3. cmd/metacache-bucket.go

    	// Entries to remove.
    	remove := make(map[string]struct{})
    
    	// Test on a copy
    	// cleanup is the only one deleting caches.
    	caches, _ := b.cloneCaches()
    
    	for id, cache := range caches {
    		if !cache.worthKeeping() {
    			b.debugf("cache %s not worth keeping", id)
    			remove[id] = struct{}{}
    			continue
    		}
    		if cache.id != id {
    			logger.Info("cache ID mismatch %s != %s", id, cache.id)
    			remove[id] = struct{}{}
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 6.6K bytes
    - Viewed (0)
Back to top