How to create recurring job every 10 minutes for only 24 hours

Tags: #<Tag:0x00007f6e451e7ea8>


When I have a new customer signup that does not complete the process, I send them an email with next steps. I need to create a job that runs every 10 minutes for the first 24 hours after signup. After that time, there is another process that takes over. I schedule the job like this:

RecurringJob.AddOrUpdate(customerId, () => NewCustomerProcess.checkNewCustomerStatus(customerId)), "*/10 * * * *");

If I add a job start time to the job class:

private DateTime _jobstart = DateTime.UtcNow;

Can I inspect that within the job to figure out when 24 hours has passed then remove the job?


Does hangfire re-instantiate the job class every time it runs?