Created
December 6, 2020 18:16
-
-
Save sfmskywalker/cbeb0972dd116a1fd458ee2792da22aa to your computer and use it in GitHub Desktop.
Simple Quartz.NET job example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services.AddQuartz(quartz => | |
{ | |
quartz.AddJob<MyJob>(j => j.WithIdentity("MyJob")); | |
quartz.AddTrigger(t => t | |
.ForJob("MyJob") | |
.StartNow() | |
.WithCronSchedule("* * * * * * *")); | |
}); | |
class MyJob : IJob | |
{ | |
public Task Execute(IJobExecutonContext context) | |
{ | |
// Do work. | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment