From 3566ad774d92d911482c2624fd49dd5a9527bf6e Mon Sep 17 00:00:00 2001 From: Glax Date: Thu, 31 Oct 2024 20:41:21 +0100 Subject: [PATCH 1/3] Moved logging to actually say if we added a job to the list --- Tranga/Jobs/JobBoss.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tranga/Jobs/JobBoss.cs b/Tranga/Jobs/JobBoss.cs index e3b8b9c..8a3a109 100644 --- a/Tranga/Jobs/JobBoss.cs +++ b/Tranga/Jobs/JobBoss.cs @@ -28,9 +28,9 @@ public class JobBoss : GlobalBase } else { - Log($"Added {job}"); if (!this.jobs.Add(job)) return false; + Log($"Added {job}"); UpdateJobFile(job, jobFile); } return true; From dc9cd4b1ddd79914f15172a23676d7c77a180392 Mon Sep 17 00:00:00 2001 From: Glax Date: Thu, 31 Oct 2024 20:41:46 +0100 Subject: [PATCH 2/3] Append ".failed" to job-files that werent successfully added. --- Tranga/Jobs/JobBoss.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tranga/Jobs/JobBoss.cs b/Tranga/Jobs/JobBoss.cs index 8a3a109..c3eebfa 100644 --- a/Tranga/Jobs/JobBoss.cs +++ b/Tranga/Jobs/JobBoss.cs @@ -167,8 +167,8 @@ public class JobBoss : GlobalBase else { Log($"Adding Job {job}"); - if(!AddJob(job, file.Name)) //If we detect a duplicate, delete the file. - file.Delete(); + if(!AddJob(job, file.FullName)) //If we detect a duplicate, delete the file. + file.MoveTo(string.Concat(file.FullName, ".failed")); } } From 9db3f1b0dae233ce1797a82ddf5638bbfabbfd52 Mon Sep 17 00:00:00 2001 From: Glax Date: Thu, 31 Oct 2024 20:42:56 +0100 Subject: [PATCH 3/3] Extend logging on startup --- Tranga/Jobs/JobBoss.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Tranga/Jobs/JobBoss.cs b/Tranga/Jobs/JobBoss.cs index c3eebfa..fd48ef6 100644 --- a/Tranga/Jobs/JobBoss.cs +++ b/Tranga/Jobs/JobBoss.cs @@ -167,8 +167,12 @@ public class JobBoss : GlobalBase else { Log($"Adding Job {job}"); - if(!AddJob(job, file.FullName)) //If we detect a duplicate, delete the file. - file.MoveTo(string.Concat(file.FullName, ".failed")); + if (!AddJob(job, file.FullName)) //If we detect a duplicate, delete the file. + { + string path = string.Concat(file.FullName, ".failed"); + file.MoveTo(path); + Log($"Duplicate detected or otherwise not able to add job to list.\nMoved job {job} to {path}"); + } } }