Fixes #697 Fixes #696pull/750/head
parent
f96424f4bd
commit
5ff1e337e5
@ -0,0 +1,28 @@
|
|||||||
|
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();
|
||||||
|
|
||||||
|
if (_diskProvider.FolderExists(updateSandboxFolder))
|
||||||
|
{
|
||||||
|
_diskProvider.DeleteFolder(updateSandboxFolder, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue