MCPcopy Index your code
hub / github.com/riverqueue/river / Work

Method Work

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

Source from the content-addressed store, hash-verified

24}
25
26func (w *SnoozingWorker) Work(ctx context.Context, job *river.Job[SnoozingArgs]) error {
27 if job.Args.ShouldSnooze {
28 fmt.Println("snoozing job for 5 minutes")
29 return river.JobSnooze(5 * time.Minute)
30 }
31 return nil
32}
33
34// Example_jobSnooze demonstrates how to snooze a job from within Work using
35// JobSnooze. The job will be run again after 5 minutes and the snooze attempt

Callers

nothing calls this directly

Calls 1

JobSnoozeFunction · 0.92

Tested by

no test coverage detected