Make the number of lines to store dynamic (#40)

This commit is contained in:
Gervasio Marchand 2023-02-14 09:13:57 -03:00 committed by GitHub
parent d9faf231a0
commit fbd47ae7cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 importedList = importedList
.Skip(importedList.Count - 5000) .Skip(importedList.Count - maxFileLines)
.ToList(); .ToList();
} }