Skip to content

Instantly share code, notes, and snippets.

@jraps20
Created July 3, 2018 13:01
Show Gist options
  • Save jraps20/517416955cb58d5a6f3513cae451a808 to your computer and use it in GitHub Desktop.
Save jraps20/517416955cb58d5a6f3513cae451a808 to your computer and use it in GitHub Desktop.
using Quartz;
public class TestJob : SiteCronBase
{
protected override void Run(IJobExecutionContext context)
{
WriteLogLine(context, "Starting SiteCron job");
// core functionality lives here
// obtain databases with Factory.GetDatabase("master"); for example
for (var i = 1; i <= 10; i++)
{
WriteLogLine(context, $"Job step: {i}");
// sleep only for illustration purposes
Thread.Sleep(1000);
}
WriteLogLine(context, "End of SiteCron job");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment