mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-12 22:17:22 +01:00
fix startup issues when csv bak cannot be written
This commit is contained in:
parent
f18493d7ee
commit
bc8d61b19d
2 changed files with 12 additions and 3 deletions
|
|
@ -29,9 +29,18 @@ public sealed class FileCacheManager : IDisposable
|
|||
|
||||
lock (_fileWriteLock)
|
||||
{
|
||||
if (File.Exists(CsvBakPath))
|
||||
try
|
||||
{
|
||||
File.Move(CsvBakPath, _csvPath, overwrite: true);
|
||||
if (File.Exists(CsvBakPath))
|
||||
{
|
||||
File.Move(CsvBakPath, _csvPath, overwrite: true);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogWarning(ex, "Failed to move BAK to ORG, deleting BAK");
|
||||
if (File.Exists(CsvBakPath))
|
||||
File.Delete(CsvBakPath);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue