Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New: Removing update folder from temp folder during housekeeping
(cherry picked from commit c1d060ff58fc466f4a2cc232bff07294cf224a9a)
- Loading branch information
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupTemporaryUpdateFiles.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
} | ||
} |