I just installed Hangfire to fire and forget a single long running task as soon as my web site starts. I am playing around with it using IIS Express via the visual studio 2013 debugger.
I can see the task getting queued and then moved to the Processing list in the dashboard when the site is started, but I am confused about what happens when I forcefully stop the website and restart it. The job that was processed before the restart still appears in the ‘Processing’ list, and the newly started job is also added.
-
What does it mean that the first job is still being processed? Surely once I stopped the website, the executable code was terminated. What does Hangfire do with that job when the site is restarted? Does it just re-execute the enqueued expression?
-
I want only a single job to run. Do I need to do some sort of cleanup when my site starts to clear jobs that were started in a subsequent launch of the website?