mirror of
https://github.com/Radarr/Radarr
synced 2025-02-22 06:11:09 +00:00
Changed: Upped rate at which we scan the download client. Should reduce cpu and ram usage as well as decrease pressure on download clients.
Also stopped warning about unable to parse a file after warning once. Should decrease ram usage as well and help with bloated log files.
This commit is contained in:
parent
173b6847e5
commit
ad3c01e986
2 changed files with 15 additions and 2 deletions
|
@ -71,7 +71,7 @@ public void Handle(ApplicationStartedEvent message)
|
||||||
|
|
||||||
var defaultTasks = new[]
|
var defaultTasks = new[]
|
||||||
{
|
{
|
||||||
new ScheduledTask{ Interval = 0.25f, TypeName = typeof(CheckForFinishedDownloadCommand).FullName},
|
new ScheduledTask{ Interval = 1, TypeName = typeof(CheckForFinishedDownloadCommand).FullName},
|
||||||
new ScheduledTask{ Interval = 1*60, TypeName = typeof(PreDBSyncCommand).FullName},
|
new ScheduledTask{ Interval = 1*60, TypeName = typeof(PreDBSyncCommand).FullName},
|
||||||
new ScheduledTask{ Interval = 5, TypeName = typeof(MessagingCleanupCommand).FullName},
|
new ScheduledTask{ Interval = 5, TypeName = typeof(MessagingCleanupCommand).FullName},
|
||||||
new ScheduledTask{ Interval = updateInterval, TypeName = typeof(ApplicationUpdateCommand).FullName},
|
new ScheduledTask{ Interval = updateInterval, TypeName = typeof(ApplicationUpdateCommand).FullName},
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NLog;
|
using NLog;
|
||||||
|
using NzbDrone.Common.Cache;
|
||||||
using NzbDrone.Common.Disk;
|
using NzbDrone.Common.Disk;
|
||||||
using NzbDrone.Common.Extensions;
|
using NzbDrone.Common.Extensions;
|
||||||
using NzbDrone.Core.Configuration;
|
using NzbDrone.Core.Configuration;
|
||||||
|
@ -37,6 +38,7 @@ public class ImportDecisionMaker : IMakeImportDecision
|
||||||
private readonly IQualityDefinitionService _qualitiesService;
|
private readonly IQualityDefinitionService _qualitiesService;
|
||||||
private readonly IConfigService _config;
|
private readonly IConfigService _config;
|
||||||
private readonly IHistoryService _historyService;
|
private readonly IHistoryService _historyService;
|
||||||
|
private readonly ICached<string> _warnedFiles;
|
||||||
private readonly Logger _logger;
|
private readonly Logger _logger;
|
||||||
|
|
||||||
public ImportDecisionMaker(IEnumerable<IImportDecisionEngineSpecification> specifications,
|
public ImportDecisionMaker(IEnumerable<IImportDecisionEngineSpecification> specifications,
|
||||||
|
@ -48,6 +50,7 @@ public ImportDecisionMaker(IEnumerable<IImportDecisionEngineSpecification> speci
|
||||||
IQualityDefinitionService qualitiesService,
|
IQualityDefinitionService qualitiesService,
|
||||||
IConfigService config,
|
IConfigService config,
|
||||||
IHistoryService historyService,
|
IHistoryService historyService,
|
||||||
|
ICacheManager cacheManager,
|
||||||
Logger logger)
|
Logger logger)
|
||||||
{
|
{
|
||||||
_specifications = specifications;
|
_specifications = specifications;
|
||||||
|
@ -59,6 +62,7 @@ public ImportDecisionMaker(IEnumerable<IImportDecisionEngineSpecification> speci
|
||||||
_qualitiesService = qualitiesService;
|
_qualitiesService = qualitiesService;
|
||||||
_config = config;
|
_config = config;
|
||||||
_historyService = historyService;
|
_historyService = historyService;
|
||||||
|
_warnedFiles = cacheManager.GetCache<string>(this.GetType());
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,8 +152,17 @@ private ImportDecision GetDecision(string file, Movie movie, DownloadClientItem
|
||||||
|
|
||||||
if (MediaFileExtensions.Extensions.Contains(Path.GetExtension(file)))
|
if (MediaFileExtensions.Extensions.Contains(Path.GetExtension(file)))
|
||||||
{
|
{
|
||||||
|
if (_warnedFiles.Find(file) == null)
|
||||||
|
{
|
||||||
|
_warnedFiles.Set(file, "warned");
|
||||||
_logger.Warn("Unable to parse movie info from path {0}", file);
|
_logger.Warn("Unable to parse movie info from path {0}", file);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_logger.Trace("Already warned user that we are unable to parse movie info from path: {0}", file);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
decision = new ImportDecision(localMovie, new Rejection("Unable to parse file"));
|
decision = new ImportDecision(localMovie, new Rejection("Unable to parse file"));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue