Hi,
I’m trying to add a cron job, but the job is never executed. I’ve tried different cron expressions without any luck.
Here’s my class:
[CronScheduler("Litium.Accelerator.SomeSyncJob", Parameter = "Some=parameter", ExecutionRestriction = ScheduleCronJobExecutionRestriction.None)]
public class SomeSyncJob : ICronScheduleJob
{
public ValueTask ExecuteAsync(object parameter, CancellationToken cancellationToken = default)
{
// Execute the sync job
return ValueTask.CompletedTask;
}
}
appsettings.json:
"Litium": {
"Scheduler": {
"Policy": {
"Litium.Auditing.CleanupScheduler": { "CronExpression": "0 45 0 1/1 * ? *" },
"Litium.Customers.TargetGroups.CleanupScheduler": { "CronExpression": "0 13 0 ? * * *" },
"Litium.Products.PriceAgentScheduler": { "CronExpression": "0 45 0 ? * * *" },
"Litium.Sales.OrderMaintenanceScheduler": { "CronExpression": "0 40 0 ? * * *" },
"Litium.Websites.SitemapScheduler": { "CronExpression": "0 25 0 ? * * *" },
"Litium.Accelerator.PurchaseHistory": { "CronExpression": "0 30 3 ? * * *" },
"Litium.Accelerator.SomeSyncJob": {
"CronExpression": "0 17 16 1/1 * ? *"
}
}
}
The problem here is that the job is never executed. I’ve tried to change the time in the cron expression to one hour before/after, and also added more delay with several minutes to the correct time. Am I missing something?
I’ve also tried with the property DefaultCronExpression
, and also tried adding the Parameter
property to appsettings.json, same story there.
Litium version: 8.3.1