Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cancel All Outstanding Recurring Jobs #14

Open
YodasMyDad opened this issue Jun 13, 2019 · 0 comments
Open

Cancel All Outstanding Recurring Jobs #14

YodasMyDad opened this issue Jun 13, 2019 · 0 comments

Comments

@YodasMyDad
Copy link

I'm using this nuget package in one of my websites, and it works great. So thanks for spending the time making this.

I have a question/query regarding RecurringJobs and app restarts/app pool recycles... I have the following code which adds a couple of cron jobs on app start.

RecurringJob.AddOrUpdate(() => new RecurringTasksService().DoSomething(), Cron.HourInterval(2));

Again they work great. However...

I was thinking what about app restarts? What happens to these recurring jobs when the app restarts (i.e. config changes, new code pushed to live etc...)... is the same job added again? Is the old job cancelled on app shutdown? I'm just concerned over time I'll end up with X times of the same recurring job.

So instead of working every 2 hours, because of the constant adding of the job on app start it's firing all the time...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant