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)
| 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. |
| 134 | func (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 |
| 144 | func (w *Work) FlushToLocal(_ context.Context, localPath string, affectedJobIDs []string) error { |
nothing calls this directly
no test coverage detected