Try our conversational search powered by Generative AI!

Schedule job not starting automatically



I have an Initialization module programmatically setting a scheduled job to run after the initialization process. As per (
This used to work in our project previously, however after upgrading to CMS12 and running this in the new sample Alloy site it has stopped working. The scheduled job does not start at all anymore.

private static void ScheduleRunNow(ScheduledJob job, IScheduledJobRepository scheduledJobRepository)
			job.IntervalType = ScheduledIntervalType.None;
			job.IntervalLength = 0;
			job.IsEnabled = true;
			job.NextExecution = DateTime.Now.AddSeconds(10);

The job does get updated with the Next Execution time, it does not get enabled and it does not run when the time passes.

Apr 29, 2022 12:50

This could be related to timing - when does your module run compared to CMS startup code. Can try to move your code to StartUp.cs and make sure it runs after CMS is initialized?

May 10, 2022 10:17
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.