Compare commits
No commits in common. "7b6724ad384ed9857c8308bfa7626cf81122cfe6" and "be68ddc9b7529f1d95a74a14974dfec92811e22a" have entirely different histories.
7b6724ad38
...
be68ddc9b7
@ -206,7 +206,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}");
|
||||||
@ -221,16 +220,12 @@ public class JobBoss : GlobalBase
|
|||||||
Log(e.ToString());
|
Log(e.ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Export job (in new file) if it is still in our jobs list
|
Log($"Exporting Job {newJobFilePath}");
|
||||||
if (GetJobById(job.id) is not null)
|
string jobStr = JsonConvert.SerializeObject(job, Formatting.Indented);
|
||||||
{
|
while(IsFileInUse(newJobFilePath))
|
||||||
Log($"Exporting Job {newJobFilePath}");
|
Thread.Sleep(10);
|
||||||
string jobStr = JsonConvert.SerializeObject(job, Formatting.Indented);
|
File.WriteAllText(newJobFilePath, jobStr);
|
||||||
while(IsFileInUse(newJobFilePath))
|
|
||||||
Thread.Sleep(10);
|
|
||||||
File.WriteAllText(newJobFilePath, jobStr);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateAllJobFiles()
|
private void UpdateAllJobFiles()
|
||||||
|
Loading…
Reference in New Issue
Block a user