(ctx context.Context, job *river.Job[CancellingArgs])
| 24 | } |
| 25 | |
| 26 | func (w *CancellingWorker) Work(ctx context.Context, job *river.Job[CancellingArgs]) error { |
| 27 | if job.Args.ShouldCancel { |
| 28 | fmt.Println("cancelling job") |
| 29 | return river.JobCancel(errors.New("this wrapped error message will be persisted to DB")) |
| 30 | } |
| 31 | return nil |
| 32 | } |
| 33 | |
| 34 | // Example_jobCancel demonstrates how to permanently cancel a job from within |
| 35 | // Work using JobCancel. |
nothing calls this directly
no test coverage detected