New: Removing update folder from temp folder during housekeeping

Closes #4178
This commit is contained in:
Mark McDowall 2021-01-02 15:13:01 -08:00
parent 101b1ec743
commit c1d060ff58
1 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,25 @@
using NzbDrone.Common.Disk;
using NzbDrone.Common.EnvironmentInfo;
using NzbDrone.Common.Extensions;
namespace NzbDrone.Core.Housekeeping.Housekeepers
{
public class CleanupTemporaryUpdateFiles : IHousekeepingTask
{
private readonly IDiskProvider _diskProvider;
private readonly IAppFolderInfo _appFolderInfo;
public CleanupTemporaryUpdateFiles(IDiskProvider diskProvider, IAppFolderInfo appFolderInfo)
{
_diskProvider = diskProvider;
_appFolderInfo = appFolderInfo;
}
public void Clean()
{
var updateSandboxFolder = _appFolderInfo.GetUpdateSandboxFolder();
_diskProvider.DeleteFolder(updateSandboxFolder, true);
}
}
}