CMS Tasks

James Mosquito asked on August 5, 2021 12:11

Hi,

We have a scheduled task that runs a product import every night. It has been observed that the task does not always start at the scheduled time and that it will begin after the first login by a user following the tasks scheduled timeslot e.g. if the task it scheduled for 01:00 and a user logs in at 07:00 it will start at 07:00.

What would be the recommended approach to ensure that tasks run at their expected times?

Thanks, James

Recent Answers


kentico guy answered on August 5, 2021 16:41

What version of Kentico are you running? That sounds like a bug.

Another possibility: Is your server perhaps going into sleep mode to save CPU when there is no traffic on the site? Some hosting services will put the site to sleep if there's nobody connected and will wake when the site gets a hit. This is typically if you have a hosted VM shared with other services, and it costs less. If this is the case you'd need to request to have the sleep mode removed from your VM.

In the event logs are you seeing any messages about the application stopping/starting when the user logs in?

If the server isn't stopping your app, it's almost certainly a bug because the scheduled task should run on time and you might need to fill out a bug report.

0 votesVote for this answer Mark as a Correct answer

James Mosquito answered on August 5, 2021 17:02

Hi,

We are using Kentico Version 12.0.93.

The website is hosted on a server which is managed by the client, so I can feedback to ask about configuring IIS to prevent the site from going to sleep.

This was observed on a staging server which has activity during the day but not currently overnight which would make sense with what you are saying above.

Thanks, James

0 votesVote for this answer Mark as a Correct answer

Sean Wright answered on August 12, 2021 00:53

To resolve this issue you can either use the Automatic Scheduler which doesn't execute based on traffic to the site, and use a 3rd party service (or Windows scheduled event) to ping the administration application on a regular interval to ensure the app pool isn't recycled from a lack of traffic.

As an example, we often use Ping Tests in Azure to ensure the app stays alive.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.