changed journal detection to cope with patch 11 changes

fixes #6
This commit is contained in:
alterNERDtive 2022-03-18 21:44:23 +01:00
parent 1758542640
commit 8623ba805f
2 changed files with 2 additions and 2 deletions

View file

@ -25,7 +25,7 @@ startup {
);
vars.currentJournal = "none";
vars.updateJournalReader = (Action)delegate() {
FileInfo journalFile = new DirectoryInfo(vars.journalPath).GetFiles("journal.*.log").OrderByDescending(file => file.Name).First();
FileInfo journalFile = new DirectoryInfo(vars.journalPath).GetFiles("journal.*.log").OrderByDescending(file => file.LastWriteTime).First();
print("Current journal file: " + vars.currentJournal + ", latest journal file: " + journalFile.Name);
if (journalFile.Name != vars.currentJournal) {
vars.journalReader = new StreamReader(new FileStream(journalFile.FullName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite));

View file

@ -49,7 +49,7 @@ startup {
);
vars.currentJournal = "none";
vars.updateJournalReader = (Action)delegate() {
FileInfo journalFile = new DirectoryInfo(vars.journalPath).GetFiles("journal.*.log").OrderByDescending(file => file.Name).First();
FileInfo journalFile = new DirectoryInfo(vars.journalPath).GetFiles("journal.*.log").OrderByDescending(file => file.LastWriteTime).First();
print("Current journal file: " + vars.currentJournal + ", latest journal file: " + journalFile.Name);
if (journalFile.Name != vars.currentJournal) {
vars.journalReader = new StreamReader(new FileStream(journalFile.FullName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite));