riverqueue / river

Fast and reliable background jobs in Go
https://riverqueue.com
Mozilla Public License 2.0
3.22k stars 86 forks source link

Cancelling periodic jobs question #358

Closed sheldondz closed 3 months ago

sheldondz commented 3 months ago

Is there a way to cancel periodic jobs using the job.ID? the documentation points to

// Remove a periodic job using handle return by Client.PeriodicJobs.Add.
riverClient.PeriodicJobs().Remove(periodicJobHandle)

Will this work even after the client is restarted? or is this only in memory?

sheldondz commented 3 months ago

I have tested this when client is running and it works fine, the periodic job no longer runs when removed using the handle.

sheldondz commented 3 months ago

After client restart the job stops running, so i am assuming for periodic jobs do we need to reload all the jobs on client restart?