Fi bug with exportjobslist not exporting updated jobs

This commit is contained in:
glax 2023-09-19 19:59:51 +02:00
parent f5b6b1785f
commit c1aa4cf6b5

View File

@ -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