MCPcopy Index your code
hub / github.com/riverqueue/river / reportQueueStatusLoop

Method reportQueueStatusLoop

producer.go:1033–1047  ·  view source on GitHub ↗
(ctx context.Context, wg *sync.WaitGroup)

Source from the content-addressed store, hash-verified

1031}
1032
1033func (p *producer) reportQueueStatusLoop(ctx context.Context, wg *sync.WaitGroup) {
1034 defer wg.Done()
1035
1036 serviceutil.CancellableSleep(ctx, randutil.DurationBetween(0, time.Second))
1037 reportTicker := time.NewTicker(p.config.QueueReportInterval)
1038 for {
1039 select {
1040 case <-ctx.Done():
1041 reportTicker.Stop()
1042 return
1043 case <-reportTicker.C:
1044 p.reportQueueStatusOnce(ctx)
1045 }
1046 }
1047}
1048
1049func (p *producer) reportQueueStatusOnce(ctx context.Context) {
1050 ctx, cancel := context.WithTimeout(ctx, 10*time.Second)

Callers 1

StartWorkContextMethod · 0.95

Calls 5

reportQueueStatusOnceMethod · 0.95
CancellableSleepFunction · 0.92
DurationBetweenFunction · 0.92
DoneMethod · 0.80
StopMethod · 0.65

Tested by

no test coverage detected