From c1aa4cf6b57f5a765f1949cb3a2be47fdf40a06f Mon Sep 17 00:00:00 2001 From: glax Date: Tue, 19 Sep 2023 19:59:51 +0200 Subject: [PATCH] Fi bug with exportjobslist not exporting updated jobs --- Tranga/Jobs/JobBoss.cs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/Tranga/Jobs/JobBoss.cs b/Tranga/Jobs/JobBoss.cs index 8ab05e4..477e402 100644 --- a/Tranga/Jobs/JobBoss.cs +++ b/Tranga/Jobs/JobBoss.cs @@ -167,14 +167,11 @@ public class JobBoss : GlobalBase foreach (Job job in this.jobs) { string jobFilePath = Path.Join(settings.jobsFolderPath, $"{job.id}.json"); - if (!File.Exists(jobFilePath)) - { - string jobStr = JsonConvert.SerializeObject(job); - while(IsFileInUse(jobFilePath)) - Thread.Sleep(10); - Log($"Exporting Job {jobFilePath}"); - File.WriteAllText(jobFilePath, jobStr); - } + string jobStr = JsonConvert.SerializeObject(job); + while(IsFileInUse(jobFilePath)) + Thread.Sleep(10); + Log($"Exporting Job {jobFilePath}"); + File.WriteAllText(jobFilePath, jobStr); } //Remove files with jobs not in this.jobs-list