Skip to content

StartupConfiguration

Furkan Güngör edited this page Feb 6, 2022 · 4 revisions

Usage

For the cron job you created, you must configure it in Startup.cs.

Do not worry. This configuration is pretty simple.

// Include Seconds
services.ApplyResulation<ConsoleCronJob>(options =>
{
    options.CronExpression = "*/10 * * * * *";
    options.TimeZoneInfo = TimeZoneInfo.Local;
    options.CronFormat = Cronos.CronFormat.IncludeSeconds;
});

// Standart
services.ApplyResulation<MyJob>(options =>
{
    options.CronExpression = "* * * * *";
    options.TimeZoneInfo = TimeZoneInfo.Local;
    options.CronFormat = Cronos.CronFormat.Standard;
});

Process completed. Now, your cron job will run when the cron expression value you specified comes.

Clone this wiki locally