mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-26 10:44:50 +03:00
add cache file deletion error handling
This commit is contained in:
@@ -128,7 +128,18 @@ namespace MediaBrowser.Common.Implementations.ScheduledTasks.Tasks
|
||||
DeleteEmptyFolders(directory);
|
||||
if (!_fileSystem.GetFileSystemEntryPaths(directory).Any())
|
||||
{
|
||||
_fileSystem.DeleteDirectory(directory, false);
|
||||
try
|
||||
{
|
||||
_fileSystem.DeleteDirectory(directory, false);
|
||||
}
|
||||
catch (UnauthorizedAccessException ex)
|
||||
{
|
||||
_logger.ErrorException("Error deleting directory {0}", ex, directory);
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
_logger.ErrorException("Error deleting directory {0}", ex, directory);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -139,6 +150,10 @@ namespace MediaBrowser.Common.Implementations.ScheduledTasks.Tasks
|
||||
{
|
||||
_fileSystem.DeleteFile(path);
|
||||
}
|
||||
catch (UnauthorizedAccessException ex)
|
||||
{
|
||||
_logger.ErrorException("Error deleting file {0}", ex, path);
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
_logger.ErrorException("Error deleting file {0}", ex, path);
|
||||
|
||||
Reference in New Issue
Block a user