I need to create a scheduled task that executes 10mins from now. However, I may need to delete that job before it has been executed. I know you get a jobid when the job is created like this:
var jobId = BackgroundJob.Schedule<MyJob>(job => job.Execute(),TimeSpan.FromMinutes(10));
However, this would require storing the jobid in a DB or cache of some sort in order to delete it in the future.
Is it possible to name a scheduled job like you can with a reoccurring job? Ideally something like this:
BackgroundJob.Schedule<MyJob>("MyJobName", job => job.Execute(),TimeSpan.FromMinutes(10));
It would obviously need to throw an exception if that job name already exists, but it would allow people to use already known data to name their jobs vs. needing to keep another data store with stateful job ids.