Compare commits

..

2 Commits

Author SHA1 Message Date
Bogdan
7a03a2197b Fixed: Trimming disabled logs database
(cherry picked from commit d5dff8e8d6301b661a713702e1c476705423fc4f)
2024-06-30 17:55:24 +00:00
Bogdan
d910fc42ab Bump mac image to 12 2024-06-26 23:51:49 +03:00
4 changed files with 14 additions and 6 deletions

View File

@@ -20,7 +20,7 @@ variables:
innoVersion: '6.2.0'
windowsImage: 'windows-2022'
linuxImage: 'ubuntu-20.04'
macImage: 'macOS-11'
macImage: 'macOS-12'
trigger:
branches:

View File

@@ -62,8 +62,8 @@ namespace NzbDrone.Core.Download
public void Check(TrackedDownload trackedDownload)
{
// Only process tracked downloads that are still downloading or import is blocked (if they fail after attempting to be processed)
if (trackedDownload.State != TrackedDownloadState.Downloading && trackedDownload.State != TrackedDownloadState.ImportBlocked)
// Only process tracked downloads that are still downloading
if (trackedDownload.State != TrackedDownloadState.Downloading)
{
return;
}

View File

@@ -115,7 +115,7 @@ namespace NzbDrone.Core.Download.TrackedDownloads
{
var trackedDownload = _trackedDownloadService.TrackDownload((DownloadClientDefinition)downloadClient.Definition, downloadItem);
if (trackedDownload is { State: TrackedDownloadState.Downloading or TrackedDownloadState.ImportBlocked })
if (trackedDownload != null && trackedDownload.State == TrackedDownloadState.Downloading)
{
_failedDownloadService.Check(trackedDownload);
_completedDownloadService.Check(trackedDownload);

View File

@@ -1,18 +1,26 @@
using NzbDrone.Core.Instrumentation;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Instrumentation;
namespace NzbDrone.Core.Housekeeping.Housekeepers
{
public class TrimLogDatabase : IHousekeepingTask
{
private readonly ILogRepository _logRepo;
private readonly IConfigFileProvider _configFileProvider;
public TrimLogDatabase(ILogRepository logRepo)
public TrimLogDatabase(ILogRepository logRepo, IConfigFileProvider configFileProvider)
{
_logRepo = logRepo;
_configFileProvider = configFileProvider;
}
public void Clean()
{
if (!_configFileProvider.LogDbEnabled)
{
return;
}
_logRepo.Trim();
}
}