MCPcopy Create free account
hub / github.com/riverqueue/river / Work

Method Work

example_job_cancel_test.go:26–32  ·  view source on GitHub ↗
(ctx context.Context, job *river.Job[CancellingArgs])

Source from the content-addressed store, hash-verified

24}
25
26func (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.

Callers

nothing calls this directly

Calls 1

JobCancelFunction · 0.92

Tested by

no test coverage detected