mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-19 04:59:35 -07:00
Import list logging improvements
(cherry picked from commit d2be869d9cee2ee6452a53dcabe20c1598fd115a) Closes #3850
This commit is contained in:
parent
f35c8a6a26
commit
db07eba461
1 changed files with 14 additions and 9 deletions
|
@ -49,10 +49,15 @@ namespace NzbDrone.Core.ImportLists
|
||||||
var importListLocal = importList;
|
var importListLocal = importList;
|
||||||
var importListStatus = _importListStatusService.GetLastSyncListInfo(importListLocal.Definition.Id);
|
var importListStatus = _importListStatusService.GetLastSyncListInfo(importListLocal.Definition.Id);
|
||||||
|
|
||||||
if (importListStatus.HasValue && DateTime.UtcNow < importListStatus + importListLocal.MinRefreshInterval)
|
if (importListStatus.HasValue)
|
||||||
{
|
{
|
||||||
_logger.Trace("Skipping refresh of Import List {0} due to minimum refresh inverval", importListLocal.Definition.Name);
|
var importListNextSync = importListStatus.Value + importListLocal.MinRefreshInterval;
|
||||||
continue;
|
|
||||||
|
if (DateTime.UtcNow < importListNextSync)
|
||||||
|
{
|
||||||
|
_logger.Trace("Skipping refresh of Import List {0} ({1}) due to minimum refresh interval. Next sync after {2}", importList.Name, importListLocal.Definition.Name, importListNextSync);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var task = taskFactory.StartNew(() =>
|
var task = taskFactory.StartNew(() =>
|
||||||
|
@ -63,7 +68,7 @@ namespace NzbDrone.Core.ImportLists
|
||||||
|
|
||||||
lock (result)
|
lock (result)
|
||||||
{
|
{
|
||||||
_logger.Debug("Found {0} from {1}", importListReports.Count, importList.Name);
|
_logger.Debug("Found {0} reports from {1} ({2})", importListReports.Count, importList.Name, importListLocal.Definition.Name);
|
||||||
|
|
||||||
result.AddRange(importListReports);
|
result.AddRange(importListReports);
|
||||||
}
|
}
|
||||||
|
@ -72,7 +77,7 @@ namespace NzbDrone.Core.ImportLists
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
_logger.Error(e, "Error during Import List Sync");
|
_logger.Error(e, "Error during Import List Sync of {0} ({1})", importList.Name, importListLocal.Definition.Name);
|
||||||
}
|
}
|
||||||
}).LogExceptions();
|
}).LogExceptions();
|
||||||
|
|
||||||
|
@ -83,7 +88,7 @@ namespace NzbDrone.Core.ImportLists
|
||||||
|
|
||||||
result = result.DistinctBy(r => new { r.Artist, r.Album }).ToList();
|
result = result.DistinctBy(r => new { r.Artist, r.Album }).ToList();
|
||||||
|
|
||||||
_logger.Debug("Found {0} reports", result.Count);
|
_logger.Debug("Found {0} total reports from {1} lists", result.Count, importLists.Count);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -96,7 +101,7 @@ namespace NzbDrone.Core.ImportLists
|
||||||
|
|
||||||
if (importList == null || !definition.EnableAutomaticAdd)
|
if (importList == null || !definition.EnableAutomaticAdd)
|
||||||
{
|
{
|
||||||
_logger.Debug("Import list not enabled, skipping.");
|
_logger.Debug("Import List {0} ({1}) is not enabled, skipping.", importList.Name, importList.Definition.Name);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,7 +126,7 @@ namespace NzbDrone.Core.ImportLists
|
||||||
|
|
||||||
lock (result)
|
lock (result)
|
||||||
{
|
{
|
||||||
_logger.Debug("Found {0} from {1}", importListReports.Count, importList.Name);
|
_logger.Debug("Found {0} reports from {1} ({2})", importListReports.Count, importList.Name, importListLocal.Definition.Name);
|
||||||
|
|
||||||
result.AddRange(importListReports);
|
result.AddRange(importListReports);
|
||||||
}
|
}
|
||||||
|
@ -130,7 +135,7 @@ namespace NzbDrone.Core.ImportLists
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
_logger.Error(e, "Error during Import List Sync");
|
_logger.Error(e, "Error during Import List Sync of {0} ({1})", importList.Name, importListLocal.Definition.Name);
|
||||||
}
|
}
|
||||||
}).LogExceptions();
|
}).LogExceptions();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue