Only update jobs that still exist
Some checks failed
Docker Image CI / build (push) Has been cancelled

This commit is contained in:
Glax 2025-03-14 00:43:46 +01:00
parent 45a8f7a038
commit 5012bbb2eb

View File

@ -124,7 +124,8 @@ public static class Tranga
foreach ((Thread thread, Job job) thread in removeFromThreadsList) foreach ((Thread thread, Job job) thread in removeFromThreadsList)
{ {
RunningJobs.Remove(thread.thread); RunningJobs.Remove(thread.thread);
context.Jobs.Update(thread.job); if(context.Jobs.Find(thread.job.JobId) is not null)
context.Jobs.Update(thread.job);
} }
context.SaveChanges(); context.SaveChanges();