I am looking at using Hangfire as a job scheduler for recurring jobs. So configuring them is simple with AddOrUpdate
, but then how do i delete it? I don't want to pollute my code with RecurringJob.RemoveIfExists()
when that job has been deleted and then have to remember to delete it later.
Is there a way to get a list of all recurring jobs and delete them when the server starts and so my code will re add them in every time? If not, if there a better way?
e.g.
Application version 1: Added new Hangfire recurring job Do something 1
Application version 2: Added new Hangfire recurring jobs Do something 2
and Do Something 3
Application version 3: Removed Hangfire recurring job Do something 2
Problem: the job will still exist on the server with error "Could not load type..." and needs to be deleted.