trigger for "at scheduler startup" #980
-
I am using quartznet as part of a larger back office database system. Running reports on schedules, overnight housekeeping tasks...etc. Built around .Net Framework 4.7.2 Currently using QuartzNet 2.x, about to jump over to Quartznet 3.x Quartznet comes with the SimpleTrigger and CronTrigger "in the box". I'm using the AdoJobStore, and if possible I would really like to avoid having to use the xml file plugin to make this work. I need to schedule some jobs to run once at scheduler startup. It looks like this is something I have to build out myself with a custom global listener and some sort of config/settings that I read in that global listener where I define which jobs I want to execute at scheduler startup. Am I missing something here? As far as I can see, there is no magic CronTrigger pattern or magic string in SimpleTrigger to indicate "RunOnceAtSchedulerStartup". I see the SchedulerShutdown plugin, but nothing similar for SchedulerStartup. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
And there are two more when you have latest version I don't think that you need listeners at all. I'd suggest that when you build your main scheduler just call:
This will create a run-once simple trigger under the hood and run it as soon as possible. |
Beta Was this translation helpful? Give feedback.
And there are two more when you have latest version
IDailyTimeIntervalTrigger
andICalendarIntervalTrigger
.I don't think that you need listeners at all. I'd suggest that when you build your main scheduler just call:
IScheduler.TriggerJob(JobKey jobKey)
This will create a run-once simple trigger under the hood and run it as soon as possible.