MCPcopy
hub / github.com/grafana/tempo / CompleteJob

Method CompleteJob

modules/backendscheduler/work/work.go:319–336  ·  view source on GitHub ↗

CompleteJob marks a job as completed in the appropriate shard

(id string)

Source from the content-addressed store, hash-verified

317
318// CompleteJob marks a job as completed in the appropriate shard
319func (w *Work) CompleteJob(id string) {
320 shard := w.getShard(id)
321 shard.mtx.Lock()
322 var j *Job
323 if jj, ok := shard.Jobs[id]; ok {
324 jj.Complete()
325 j = jj
326 }
327 shard.mtx.Unlock()
328
329 if j != nil {
330 w.pendingMtx.Lock()
331 for _, key := range runningBlockKeys(j) {
332 delete(w.runningBlocks, key)
333 }
334 w.pendingMtx.Unlock()
335 }
336}
337
338// FailJob marks a job as failed in the appropriate shard
339func (w *Work) FailJob(id string) {

Callers

nothing calls this directly

Calls 3

getShardMethod · 0.95
runningBlockKeysFunction · 0.85
CompleteMethod · 0.45

Tested by

no test coverage detected