Task scheduling via external server

CSS Team asked on March 2, 2021 16:24

I noticed that for newsletters, created within the email marketing module, that are sent scheduled (not immediately), a separate system task is created. How can these system tasks be send via external service? Right now, they are only send, if someone requests the backend. We are using K13 MVC and the external service is installed and running.

Correct Answer

Juraj Ondrus answered on March 3, 2021 07:26

Some of the system tasks need to have the context - so they cannot be processed by external service. Just like in this case. Then, you need to keep in mind how the scheduler works and also what is it's reliability. By default, the automatic scheduler is used in Kentico 13 (older versions were using the request mode by default). But still, the scheduler used by the Xperience administration and live site applications runs within the ASP.NET process, so tasks cannot be executed if the corresponding web application is not running. So, you would need to ensure the application is always up and running (AlwaysOn setting in IIS does not mean that IIS will start the app in case of some failure or error just so - it will be started on the first request). So, therefore it is recommended to use some service which will periodically make a request to the admin app (to the admin domain or /admin path).
Also, in this case the task needs the Kentico admin app context, so it cannot be executed within the live site either.

2 votesVote for this answer Unmark Correct answer

Recent Answers


David te Kloese answered on March 2, 2021 16:43

How is your site hosted?

If it's windows based you can register and use the external service: https://docs.xperience.io/configuring-xperience/scheduling-tasks/installing-the-scheduler-windows-service

However... as you stated as long as someone requests the back-end it will also work that way.

In Azure you have the feature for Keep Alive (which will periodically call your app service url).

Or in case you have any monitoring service you use just add an admin url to this.

0 votesVote for this answer Mark as a Correct answer

Dmitry Bastron answered on March 2, 2021 17:20

Hi,

It is also worth checking that Settings > System: Scheduler: Use external service checkbox is checked. Otherwise, settings defined on the tasks will not be taken into account.

Or are you saying that these system tasks generated are without this checkbox checked when they are created?

0 votesVote for this answer Mark as a Correct answer

CSS Team answered on March 2, 2021 23:36 (last edited on March 2, 2021 23:36)

That's exactly my problem, those system tasks are created without that checkbox and I cant't find a way to let them run by the external service. Or in other words: Is there a way to schedule newsletters for a certain time in the future without having the site constantly being browsed by users or some external monitoring tool?

0 votesVote for this answer Mark as a Correct answer

CSS Team answered on March 3, 2021 11:06 (last edited on March 3, 2021 11:07)

Thanks for your answer! Maybe you should overthink this scheduling feature as customers rely on it and have to spend extra money to make it properly work...

0 votesVote for this answer Mark as a Correct answer

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