From fbd47ae7cd013a6422cdd2acd2785cf5b4a18cde Mon Sep 17 00:00:00 2001 From: Gervasio Marchand Date: Tue, 14 Feb 2023 09:13:57 -0300 Subject: [PATCH] Make the number of lines to store dynamic (#40) --- src/Program.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Program.cs b/src/Program.cs index f24aa24..ef144d2 100644 --- a/src/Program.cs +++ b/src/Program.cs @@ -154,10 +154,12 @@ foreach (var statusLink in statusesToLoad) } } -if (importedList.Count > 5000) +var maxFileLines = sitesTags.Count * 40; +if (importedList.Count > maxFileLines) { + Console.WriteLine($"Keeping the last {maxFileLines} on the status file"); importedList = importedList - .Skip(importedList.Count - 5000) + .Skip(importedList.Count - maxFileLines) .ToList(); }