- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 23 for NewTimer (0.14 sec)
-
internal/cachevalue/cache_test.go
package cachevalue import ( "context" "errors" "testing" "time" ) func slowCaller(ctx context.Context) error { sl := time.NewTimer(time.Second) defer sl.Stop() select { case <-sl.C: case <-ctx.Done(): return ctx.Err() } return nil } func TestCacheCtx(t *testing.T) { cache := New[time.Time]() t.Parallel()
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Thu May 09 00:51:34 UTC 2024 - 2.7K bytes - Viewed (0) -
internal/dsync/dsync_test.go
if !dm.GetLock(ctx, cancel, id, source, Options{Timeout: 5 * time.Minute}) { t.Fatal("GetLock() should be successful") } // Make it run twice. timer := time.NewTimer(testDrwMutexRefreshInterval * 2) select { case <-ctx.Done(): t.Fatal("Lock context canceled which is not expected") case <-timer.C: } // Should be safe operation in all cases
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Wed Jun 19 14:35:19 UTC 2024 - 11.1K bytes - Viewed (0) -
cmd/callhome.go
return true } ctx = lkctx.Context() defer locker.Unlock(lkctx) // Perform callhome once and then keep running it at regular intervals. performCallhome(ctx) callhomeTimer := time.NewTimer(globalCallhomeConfig.FrequencyDur()) defer callhomeTimer.Stop() for { if !globalCallhomeConfig.Enabled() { // Stop the processing as callhome got disabled return false } select {
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Fri May 17 16:53:34 UTC 2024 - 5.3K bytes - Viewed (0) -
cmd/bucket-targets.go
} clnt.SetCustomTransport(globalRemoteTargetTransport) return clnt } // heartBeat performs liveness check on remote endpoints. func (sys *BucketTargetSys) heartBeat(ctx context.Context) { hcTimer := time.NewTimer(defaultHealthCheckDuration) defer hcTimer.Stop() for { select { case <-hcTimer.C: sys.hMutex.RLock() eps := make([]madmin.ServerProperties, 0, len(sys.hc)) for _, ep := range sys.hc {
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Fri Jun 21 22:22:24 UTC 2024 - 20.9K bytes - Viewed (0) -
cmd/lock-rest-server.go
// that have not been refreshed for some time. func lockMaintenance(ctx context.Context) { if !globalIsDistErasure { return } // Initialize a new ticker with 1 minute between each ticks. lkTimer := time.NewTimer(lockMaintenanceInterval) // Stop the timer upon returning. defer lkTimer.Stop() for { // Verifies every minute for locks held more than 2 minutes. select { case <-ctx.Done(): return
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Mon Jul 29 18:10:04 UTC 2024 - 5.8K bytes - Viewed (0) -
cmd/site-replication-utils.go
if st == ResyncFailed { m.FailedBuckets = append(m.FailedBuckets, b) } } return &m } // save in-memory stats to disk func (sm *siteResyncMetrics) save(ctx context.Context) { sTimer := time.NewTimer(siteResyncSaveInterval) defer sTimer.Stop() for { select { case <-sTimer.C: if globalSiteReplicationSys.isEnabled() { sm.Lock() wg := sync.WaitGroup{}
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Thu Jan 18 07:03:17 UTC 2024 - 8.9K bytes - Viewed (0) -
cmd/erasure-sets.go
r := rand.New(rand.NewSource(time.Now().UnixNano())) time.Sleep(time.Duration(r.Float64() * float64(time.Second))) // Pre-emptively connect the disks if possible. s.connectDisks(false) monitor := time.NewTimer(monitorInterval) defer monitor.Stop() for { select { case <-ctx.Done(): return case <-monitor.C: if serverDebugLog { console.Debugln("running drive monitoring") }
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Fri Sep 27 10:41:37 UTC 2024 - 37K bytes - Viewed (1) -
cmd/admin-heal-ops.go
} func (ahs *allHealState) periodicHealSeqsClean(ctx context.Context) { // Launch clean-up routine to remove this heal sequence (after // it ends) from the global state after timeout has elapsed. periodicTimer := time.NewTimer(time.Minute * 5) defer periodicTimer.Stop() for { select { case <-periodicTimer.C: now := UTCNow() ahs.Lock() for path, h := range ahs.healSeqMap {
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Sat Oct 26 09:58:27 UTC 2024 - 25.6K bytes - Viewed (0) -
cmd/metrics-resource.go
func startResourceMetricsCollection() { initLatestValues() resourceMetricsMapMu.Lock() resourceMetricsMap = map[MetricSubsystem]ResourceMetrics{} resourceMetricsMapMu.Unlock() metricsTimer := time.NewTimer(resourceMetricsCollectionInterval) defer metricsTimer.Stop() collectLocalResourceMetrics() for { select { case <-GlobalContext.Done(): return case <-metricsTimer.C:
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Wed Jul 24 23:30:33 UTC 2024 - 17.2K bytes - Viewed (0) -
cmd/bucket-metadata-sys.go
} func (sys *BucketMetadataSys) refreshBucketsMetadataLoop(ctx context.Context) { const bucketMetadataRefresh = 15 * time.Minute sleeper := newDynamicSleeper(2, 150*time.Millisecond, false) t := time.NewTimer(bucketMetadataRefresh) defer t.Stop() for { select { case <-ctx.Done(): return case <-t.C: buckets, err := sys.objAPI.ListBuckets(ctx, BucketOptions{NoMetadata: true}) if err != nil {
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Wed Aug 28 15:32:18 UTC 2024 - 20.4K bytes - Viewed (0)