MCPcopy
hub / github.com/kopia/kopia / maybeReportProgress

Method maybeReportProgress

internal/parallelwork/parallel_work_queue.go:138–146  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

136}
137
138func (v *Queue) maybeReportProgress(ctx context.Context) {
139 if clock.Now().Before(v.nextReportTime) {
140 return
141 }
142
143 v.nextReportTime = clock.Now().Add(1 * time.Second)
144
145 v.reportProgress(ctx)
146}
147
148// OnNthCompletion invokes the provided callback once the returned callback function has been invoked exactly n times.
149func OnNthCompletion(n int, callback CallbackFunc) CallbackFunc {

Callers 3

enqueueMethod · 0.95
dequeueMethod · 0.95
completedMethod · 0.95

Calls 4

reportProgressMethod · 0.95
NowFunction · 0.92
BeforeMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected