2

I'm using Sitecore 9.3, I have a custom scheduled task for rebuilding the Sitecore search index at night.

My project is hosted on Azure environment, I noticed that if I restart the CM app service then the task gets triggered and rebuilds the index as a result.

I don't want that, I tried to reproduce the issue on my machine, but it didn't happen.

Schedule time is: 20210803T235900||127|23:59:00

2
  • Does it happen on restart of app service by clicking stop and start from portal.azure.com? I cannot think of any reason. More probable is that the job schedule item is synchronized and "Last Run" field is either cleared or set to an old date. Nov 17, 2021 at 16:00
  • It happened yes after clicking restart on portal.azure.com. Last Run field is not cleared, it was older date, because the task were run at this date Nov 19, 2021 at 12:25

1 Answer 1

4

Sitecore's built-in Tasks -> Schedulers functionality works well when you need to execute a task occasionally, but it becomes problematic if you require to run some routine at a certain time every day.

You can schedule a task to run every 24 hours, but you cannot ensure that it will run at exact the same time every day because of the interval-based nature of the scheduled execution.

Task schedule in Sitecore is based on the interval execution, not on the absolute time. Sitecore periodically performs a check for any tasks that are due to run. Time between checking for scheduled tasks waiting to execute is defined in Sitecore config file, see scheduling -> frequency setting.

Therefore, it is almost impossible to schedule a task to execute at the specific hour and minute of a day.

1
  • Thanks for your reply, yes I think it happened randomly after restarting the CM server Nov 19, 2021 at 12:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.