You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My setup is probably a bit unconventional, but works for my use case:
ASP.NET Core 8 Blazor app
I add a scheduler as singleton (one method call that schedules all jobs/triggers and starts it); main reason is, that I have to schedule jobs via the frontend and so I can inject the scheduler
Looks like (in the Program.cs):
builder.Services.AddSingleton(awaitSetupSchedulerAsync());// <-- here I create my scheduler with the StdSchedulerFactory, schedule all jobs with cron triggers, and start it
I have a lot of jobs in this setup method, but all of them have in common, that they are scheduled with a cron trigger (this is necessary to understand my question), so persisting makes no sense.
But here is my problem: I now want to implement some jobs, which can be scheduled via front-end but only for one execution (should be deleted afterwards). If I run this with the RAMJobStore, everything works, but if e.g. the container crashes and restarts before the job was executed it is lost.
So: when I make the scheduler persistent, I run into this problem, where all missed cron trigger where fired immediately and quite often when disabled and re-enabled in the frontend (leading into rate limits of some online services I call).
My question is: can I make a scheduler partly persistent, meaning only for jobs of a particular group?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi
My setup is probably a bit unconventional, but works for my use case:
Looks like (in the
Program.cs
):I have a lot of jobs in this setup method, but all of them have in common, that they are scheduled with a cron trigger (this is necessary to understand my question), so persisting makes no sense.
But here is my problem: I now want to implement some jobs, which can be scheduled via front-end but only for one execution (should be deleted afterwards). If I run this with the
RAMJobStore
, everything works, but if e.g. the container crashes and restarts before the job was executed it is lost.So: when I make the scheduler persistent, I run into this problem, where all missed cron trigger where fired immediately and quite often when disabled and re-enabled in the frontend (leading into rate limits of some online services I call).
My question is: can I make a scheduler partly persistent, meaning only for jobs of a particular group?
Beta Was this translation helpful? Give feedback.
All reactions