This is a basic implementation of Scheduled tasks for Xperience by Kentico. This package does not store information in the database. This means that tasks do not retain their next execution time or execution count between application restarts. Tasks will run at at application start, after their interval has passed. For example, if the application is started at 7:00, a task with an interval of 5 minutes will execute at 7:05.
Xperience Version | Library Version |
---|---|
29.x.y | >=1.x.y |
Add the package to your application using the .NET CLI
dotnet add package XperienceCommunity.Tasks
Add the following to your application's startup code:
builder.Services.AddKenticoTasks();
Create one or more classes implementing IXperienceTask
to run your custom code:
public class MyTask : IXperienceTask
{
public XperienceTaskSettings Settings => new(nameof(MyTask), 1);
public Task Execute(CancellationToken cancellationToken)
{
// Do something...
}
}
View the Usage Guide for more detailed instructions.