Esempio n. 1
0
        private async Task SetJournalFile()
        {
            try
            {
                var newJournalFile = await _journalProvider.FindJournalFile(JournalDirectory);

                if (JournalFile?.FullName == newJournalFile.FullName)
                {
                    return;
                }

                _log.LogInformation("Setting journal file to {filePath}", newJournalFile.Name);

                if (!newJournalFile.Name.Contains("Journal"))
                {
                    _log.LogWarning(
                        new InvalidJournalFileException(
                            $"The selected journal file '{newJournalFile.Name}' does not match standard naming conventions"),
                        "Invalid journal file detected, errors may occur");
                }

                JournalFile = newJournalFile;
            }
            catch (Exception ex)
            {
                _log.LogWarning(ex, "Could not find the active journal file");
                throw;
            }
        }
Esempio n. 2
0
        private async Task SetJournalFile()
        {
            try
            {
                FileInfo newJournalFile = await _journalProvider.FindJournalFile(JournalDirectory);

                if (JournalFile?.FullName == newJournalFile.FullName)
                {
                    return;
                }

                _log.LogInformation("Setting journal file to {filePath}", newJournalFile.Name);
                JournalFile = newJournalFile;
            }
            catch (Exception ex)
            {
                _log.LogWarning(ex, "Could not find the active journal file");
                throw;
            }
        }