-
Notifications
You must be signed in to change notification settings - Fork 9
Cron Services
Furkan Güngör edited this page Jun 12, 2021
·
1 revision
Install EasyCronJob.Core
from Nuget Package
Add your own cron services.
For Example;
public class ConsoleCronJob : CronJobService
{
private readonly ILogger<ConsoleCronJob> logger;
public ConsoleCronJob(ICronConfiguration<ConsoleCronJob> cronConfiguration, ILogger<ConsoleCronJob> logger)
: base(cronConfiguration.CronExpression,cronConfiguration.TimeZoneInfo)
{
this.logger = logger;
}
public override Task StartAsync(CancellationToken cancellationToken)
{
logger.LogInformation("Start");
return base.StartAsync(cancellationToken);
}
protected override Task ScheduleJob(CancellationToken cancellationToken)
{
logger.LogInformation("Scheduled");
return base.ScheduleJob(cancellationToken);
}
public override Task DoWork(CancellationToken cancellationToken)
{
logger.LogInformation("Do Work");
return base.DoWork(cancellationToken);
}
}
Welcome to the EasyCronJob wiki!
Topics:
-
Getting Started
-
Integration
-
Other