Skip to content

Commit

Permalink
refactor(Program.cs): move triggers sorting logic to a more appropria…
Browse files Browse the repository at this point in the history
…te location

This change improves code readability by placing the sorting logic immediately after the triggers list is populated.
  • Loading branch information
Jossec101 committed Dec 6, 2023
1 parent 5cbb474 commit 11d297b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ async Task ManageJobs(ISchedulerFactory schedulerFactory)
Console.WriteLine($"PAUSED_JOBS env var is {pauseJobs}");
var scheduler = Task.Run(() => schedulerFactory.GetScheduler()).Result;
var triggers = (await scheduler.GetTriggerKeys(GroupMatcher<TriggerKey>.AnyGroup())).ToList();
triggers = triggers.OrderBy(x => x.Name).ToList();

var triggersIndex = triggers.Select(x=> new
{
Expand All @@ -86,7 +87,6 @@ async Task ManageJobs(ISchedulerFactory schedulerFactory)
await scheduler.ResumeAll();

// Get a list of all triggers
triggers = triggers.OrderBy(x => x.Name).ToList();
foreach (var triggerKey in triggers)
{
var trigger = await scheduler.GetTrigger(triggerKey);
Expand Down

0 comments on commit 11d297b

Please sign in to comment.