Skip to content

Instantly share code, notes, and snippets.

@sfmskywalker
Created December 6, 2020 18:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sfmskywalker/cbeb0972dd116a1fd458ee2792da22aa to your computer and use it in GitHub Desktop.
Save sfmskywalker/cbeb0972dd116a1fd458ee2792da22aa to your computer and use it in GitHub Desktop.
Simple Quartz.NET job example
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