diff --git a/API/Tranga.cs b/API/Tranga.cs index e6d89a3..a9d9647 100644 --- a/API/Tranga.cs +++ b/API/Tranga.cs @@ -79,6 +79,9 @@ public static class Tranga List runJobs = context.Jobs.Where(j => j.state <= JobState.Running).ToList().Where(j => j.NextExecution < DateTime.UtcNow).ToList(); foreach (Job job in runJobs) { + // If the job is already running, skip it + if (RunningJobs.Values.Any(j => j.JobId == job.JobId)) continue; + Thread t = new (() => { IEnumerable newJobs = job.Run(context);