From 4b3bb2b5bd908d1228c181f3cee47c7b4c0ac172 Mon Sep 17 00:00:00 2001 From: iPromKnight Date: Sun, 3 Mar 2024 04:10:14 +0000 Subject: [PATCH] hotfix continue, not break - add slight delay - log params --- src/producer/Features/Crawlers/Torrentio/TorrentioCrawler.cs | 3 ++- src/producer/Features/DataProcessing/ImdbMongoDbService.cs | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/producer/Features/Crawlers/Torrentio/TorrentioCrawler.cs b/src/producer/Features/Crawlers/Torrentio/TorrentioCrawler.cs index 2e5e82e..d135a95 100644 --- a/src/producer/Features/Crawlers/Torrentio/TorrentioCrawler.cs +++ b/src/producer/Features/Crawlers/Torrentio/TorrentioCrawler.cs @@ -44,7 +44,8 @@ public partial class TorrentioCrawler( if (items.Count == 0) { logger.LogInformation("No items to process for {TorrentioInstance}", instance.Name); - break; + await Task.Delay(10000); + continue; } var newTorrents = new List(); diff --git a/src/producer/Features/DataProcessing/ImdbMongoDbService.cs b/src/producer/Features/DataProcessing/ImdbMongoDbService.cs index cfa9eda..931dee5 100644 --- a/src/producer/Features/DataProcessing/ImdbMongoDbService.cs +++ b/src/producer/Features/DataProcessing/ImdbMongoDbService.cs @@ -17,6 +17,11 @@ public class ImdbMongoDbService public async Task> GetImdbEntriesForRequests(string startYear, int requestLimit, string? startingId = null) { + _logger.LogInformation("Getting IMDB entries for requests"); + _logger.LogInformation("Start year: {StartYear}", startYear); + _logger.LogInformation("Request limit: {RequestLimit}", requestLimit); + _logger.LogInformation("Starting ID: {StartingId}", startingId); + var sort = Builders.Sort .Descending(e => e.StartYear) .Descending(e => e.ImdbId);