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

Method RegisterJob

modules/backendscheduler/work/work.go:134–141  ·  view source on GitHub ↗

RegisterJob registers a job before it enters the channel pipeline, making it visible to other components (e.g. HasJobsForTenant, BusyBlocksForTenant). Call this immediately after creating a job, before sending it to the jobs channel. The registration is cleared automatically when AddJob promotes the

(job *Job)

Source from the content-addressed store, hash-verified

132// Call this immediately after creating a job, before sending it to the jobs channel.
133// The registration is cleared automatically when AddJob promotes the job to active.
134func (w *Work) RegisterJob(job *Job) {
135 w.pendingMtx.Lock()
136 w.registeredJobs[job.ID] = job
137 for _, key := range runningBlockKeys(job) {
138 w.runningBlocks[key] = job
139 }
140 w.pendingMtx.Unlock()
141}
142
143// FlushToLocal writes the work cache to local storage using sharding optimizations
144func (w *Work) FlushToLocal(_ context.Context, localPath string, affectedJobIDs []string) error {

Callers

nothing calls this directly

Calls 1

runningBlockKeysFunction · 0.85

Tested by

no test coverage detected