- Sort Score
- Num 10 results
- Language All
Results 1 - 5 of 5 for GetWithCtx (0.05 seconds)
The search processing time has exceeded the limit. The displayed results may be partial.
-
internal/cachevalue/cache.go
t.Once.Do(func() { t.ttl = ttl t.updateFn = update t.opts = opts }) } // GetWithCtx will return a cached value or fetch a new one. // passes a caller context, if caller context cancels nothing // is cached. // If the Update function returns an error the value is forwarded as is and not cached. func (t *Cache[T]) GetWithCtx(ctx context.Context) (T, error) { v := t.val.Load() ttl := t.ttl vTime := t.lastUpdateMs.Load()
Created: 2026-04-05 19:28 - Last Modified: 2024-05-24 12:50 - 4.4K bytes - Click Count (0) -
internal/cachevalue/cache_test.go
cancel() // cancel context to test. _, err := cache.GetWithCtx(ctx) if !errors.Is(err, context.Canceled) { t.Fatalf("expected context.Canceled err, got %v", err) } ctx, cancel = context.WithCancel(t.Context()) defer cancel() t1, err := cache.GetWithCtx(ctx) if err != nil { t.Fatalf("expected nil err, got %v", err) } t2, err := cache.GetWithCtx(ctx) if err != nil {
Created: 2026-04-05 19:28 - Last Modified: 2025-04-09 14:28 - 2.7K bytes - Click Count (0) -
cmd/data-usage.go
// decodeDirObject to avoid any __XLDIR__ objects m[prefix] += uint64(usageInfo.Size) } } } } return m, nil }, ) return prefixUsageCache.GetWithCtx(ctx) } func loadDataUsageFromBackend(ctx context.Context, objAPI ObjectLayer) (DataUsageInfo, error) { buf, err := readConfig(ctx, objAPI, dataUsageObjNamePath) if err != nil {
Created: 2026-04-05 19:28 - Last Modified: 2024-05-09 00:51 - 5.6K bytes - Click Count (0) -
cmd/storage-rest-client.go
} info = *infop if info.Error != "" { return info, toStorageErr(errors.New(info.Error)) } return info, nil }, ) return client.diskInfoCache.GetWithCtx(ctx) } // MakeVolBulk - create multiple volumes in a bulk operation. func (client *storageRESTClient) MakeVolBulk(ctx context.Context, volumes ...string) (err error) { return errInvalidArgument }Created: 2026-04-05 19:28 - Last Modified: 2025-08-08 02:38 - 30.4K bytes - Click Count (0) -
cmd/xl-storage-disk-id-check.go
} for i := range p.apiCalls { diskMetric.APICalls[storageMetric(i).String()] = atomic.LoadUint64(&p.apiCalls[i]) } return diskMetric, nil }, ) diskMetric, _ := p.metricsCache.GetWithCtx(context.Background()) // Do not need this value to be cached. diskMetric.TotalErrorsTimeout = p.totalErrsTimeout.Load() diskMetric.TotalErrorsAvailability = p.totalErrsAvailability.Load() return diskMetric }Created: 2026-04-05 19:28 - Last Modified: 2025-04-25 05:41 - 34.5K bytes - Click Count (0)