diff --git a/Tranga/Jobs/JobBoss.cs b/Tranga/Jobs/JobBoss.cs index c05beae..34a6bd6 100644 --- a/Tranga/Jobs/JobBoss.cs +++ b/Tranga/Jobs/JobBoss.cs @@ -14,13 +14,6 @@ public class JobBoss : GlobalBase this.mangaConnectorJobQueue = new(); } - public void MonitorJobs() - { - foreach (Job job in jobs.Where(job => job.nextExecution < DateTime.Now && !QueueContainsJob(job)).OrderBy(job => job.nextExecution)) - AddJobToQueue(job); - CheckJobQueue(); - } - public void AddJob(Job job) { this.jobs.Add(job); @@ -53,8 +46,10 @@ public class JobBoss : GlobalBase AddJobToQueue(job); } - private void CheckJobQueue() + public void CheckJobs() { + foreach (Job job in jobs.Where(job => job.nextExecution < DateTime.Now && !QueueContainsJob(job)).OrderBy(job => job.nextExecution)) + AddJobToQueue(job); foreach (Queue jobQueue in mangaConnectorJobQueue.Values) { Job queueHead = jobQueue.Peek();