How can I parameterise this method and make it more flexible?
Advertisements I’m writing a method to create Quartz scheduling jobs in C#. Currently it looks like this. private async Task BuildJobs(int startHour, int endHour, int intervalOffsetSeconds = 0) { try { var job = JobBuilder.Create<RepostTransactionsJob>() .WithIdentity(nameof(RepostTransactionsJob), TriggerGroup) .WithDescription("Reposting transactions") .Build(); var trigger = TriggerBuilder.Create() .WithIdentity(string.Concat(nameof(RepostTransactionsJob), "-trigger"), TriggerGroup) .WithSchedule(CronScheduleBuilder.CronSchedule(string.Format("{2:ss} {2:mm} {0}-{1} ? * * *", startHour,… Read More How can I parameterise this method and make it more flexible?