2
0

Compare commits

..

No commits in common. "c11c68d6d752b509ac15a97d58b9262424320ea7" and "e86ad03b1e78381fb20f73405d8b8788e1c1c28b" have entirely different histories.

View File

@ -191,7 +191,6 @@ public class JobBoss : GlobalBase
string newJobFilePath = Path.Join(TrangaSettings.jobsFolderPath, $"{job.id}.json"); string newJobFilePath = Path.Join(TrangaSettings.jobsFolderPath, $"{job.id}.json");
string oldFilePath = Path.Join(TrangaSettings.jobsFolderPath, oldFile); string oldFilePath = Path.Join(TrangaSettings.jobsFolderPath, oldFile);
//Delete old file
if (File.Exists(oldFilePath)) if (File.Exists(oldFilePath))
{ {
Log($"Deleting Job-file {oldFilePath}"); Log($"Deleting Job-file {oldFilePath}");
@ -207,16 +206,12 @@ public class JobBoss : GlobalBase
} }
} }
//Export job (in new file) if it is still in our jobs list
if (GetJobById(job.id) is not null)
{
Log($"Exporting Job {newJobFilePath}"); Log($"Exporting Job {newJobFilePath}");
string jobStr = JsonConvert.SerializeObject(job, Formatting.Indented); string jobStr = JsonConvert.SerializeObject(job, Formatting.Indented);
while(IsFileInUse(newJobFilePath)) while(IsFileInUse(newJobFilePath))
Thread.Sleep(10); Thread.Sleep(10);
File.WriteAllText(newJobFilePath, jobStr); File.WriteAllText(newJobFilePath, jobStr);
} }
}
private void UpdateAllJobFiles() private void UpdateAllJobFiles()
{ {