protected override async Task Done() { JobQueueModule.RegisterJob <NameCheckerJob>(ProcessJob); if (JobQueueModule.GetJob <NameCheckerJob>(_ => true) == null) { await JobQueueModule.AddJob(new NameCheckerJob("RecruitmentModule", GetNameJobStart())); } }
async Task ProcessJob(NameCheckerJob job) { try { await UpdateNames(); // Requeue the command to ensure loop. await JobQueueModule.AddJob(new NameCheckerJob("RecruitmentModule", DateTime.UtcNow + new TimeSpan(Config.NameCheckInterval, 0, 0))); } catch (Exception e) { Console.WriteLine(e); } }