Performance/cache epub (#438)

Changed: (Performance) Added the ability for epubs to cache, allowing faster page load for users with network mounted storage. (Fixes Investigate caching epubs (benefit for network mounted users) #433 )
This commit is contained in:
Joseph Milazzo
2021-07-25 19:43:37 -05:00
committed by GitHub
parent 3dbe7eec1f
commit 3c9f73ce2c
7 changed files with 68 additions and 21 deletions
+12 -5
View File
@@ -106,11 +106,18 @@ namespace API.Services
public void CopyFileToDirectory(string fullFilePath, string targetDirectory)
{
var fileInfo = new FileInfo(fullFilePath);
if (fileInfo.Exists)
{
fileInfo.CopyTo(Path.Join(targetDirectory, fileInfo.Name));
}
try
{
var fileInfo = new FileInfo(fullFilePath);
if (fileInfo.Exists)
{
fileInfo.CopyTo(Path.Join(targetDirectory, fileInfo.Name), true);
}
}
catch (Exception ex)
{
_logger.LogError(ex, "There was a critical error when copying {File} to {Directory}", fullFilePath, targetDirectory);
}
}
/// <summary>