I have a C# Topshelf windows Service that processes Quartz Jobs. Those jobs are stored in the database, like this:
public class JobConfiguration : IJobConfiguration {
public string Name { get; set; } //ImportService
public string Type { get; set; } //[ClassName, AssemblyName]
public string CronTrigger { get; set; } //example: 0 0 12 * * ?
public string CronMeaning { get; set; } //example: fire at noon every day
}
Now I have to add a Job that is only fired once (all other jobs had to be repeated). My (temporary) solution is to leave the CronTrigger field NULL and start those jobs with a SimpleTrigger instead of a CronTrigger like:
if (JobConfiguration.CronTrigger == Null)
//start job with Quartz SimpleTrigger
else
//start job with Quartz CronTrigger
Is there a better solution to do this? In other words: is there a CronTrigger that allows you to start a job only once and never repeat it.