From 482fcb710209d48a4a0c7d6fa66100cbbc62c117 Mon Sep 17 00:00:00 2001 From: glax Date: Tue, 19 Sep 2023 23:24:39 +0200 Subject: [PATCH] better logging for removing files --- Tranga/Jobs/JobBoss.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Tranga/Jobs/JobBoss.cs b/Tranga/Jobs/JobBoss.cs index 6ecd8ea..8640600 100644 --- a/Tranga/Jobs/JobBoss.cs +++ b/Tranga/Jobs/JobBoss.cs @@ -165,12 +165,12 @@ public class JobBoss : GlobalBase public void ExportJob(Job job) { string jobFilePath = Path.Join(settings.jobsFolderPath, $"{job.id}.json"); - Log($"Exporting Job {jobFilePath}"); if (!this.jobs.Any(jjob => jjob.id == job.id)) { try { + Log($"Deleting Job-file {jobFilePath}"); while(IsFileInUse(jobFilePath)) Thread.Sleep(10); File.Delete(jobFilePath); @@ -182,6 +182,7 @@ public class JobBoss : GlobalBase } else { + Log($"Exporting Job {jobFilePath}"); string jobStr = JsonConvert.SerializeObject(job); while(IsFileInUse(jobFilePath)) Thread.Sleep(10);