fix startup issues when csv bak cannot be written

This commit is contained in:
Stanley Dimant
2023-03-23 16:39:19 +01:00
parent f18493d7ee
commit bc8d61b19d
2 changed files with 12 additions and 3 deletions

View File

@@ -28,12 +28,21 @@ public sealed class FileCacheManager : IDisposable
_csvPath = Path.Combine(configService.ConfigurationDirectory, "FileCache.csv"); _csvPath = Path.Combine(configService.ConfigurationDirectory, "FileCache.csv");
lock (_fileWriteLock) lock (_fileWriteLock)
{
try
{ {
if (File.Exists(CsvBakPath)) if (File.Exists(CsvBakPath))
{ {
File.Move(CsvBakPath, _csvPath, overwrite: true); 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);
}
}
if (File.Exists(_csvPath)) if (File.Exists(_csvPath))
{ {

View File

@@ -3,7 +3,7 @@
<PropertyGroup> <PropertyGroup>
<Authors></Authors> <Authors></Authors>
<Company></Company> <Company></Company>
<Version>0.8.13</Version> <Version>0.8.14</Version>
<Description></Description> <Description></Description>
<Copyright></Copyright> <Copyright></Copyright>
<PackageProjectUrl>https://github.com/Penumbra-Sync/client</PackageProjectUrl> <PackageProjectUrl>https://github.com/Penumbra-Sync/client</PackageProjectUrl>