CompleteJob marks a job as completed in the appropriate shard
(id string)
| 317 | |
| 318 | // CompleteJob marks a job as completed in the appropriate shard |
| 319 | func (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 |
| 339 | func (w *Work) FailJob(id string) { |
nothing calls this directly
no test coverage detected