From 0130d63551e42ffd88c8bedb2f474454ec85fd1e Mon Sep 17 00:00:00 2001 From: lub Date: Tue, 2 Feb 2021 20:28:30 +0100 Subject: [PATCH] use hardcoded cache size instead of len(blog) It seems the blog posts are not rotated strictly chronologically, so sometimes previously already posted things got posted again. --- scrape.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scrape.py b/scrape.py index 24e91bc..94ab943 100644 --- a/scrape.py +++ b/scrape.py @@ -176,9 +176,7 @@ async def main(): pass # trim the cache - # len(blog) is usually bigger than the count of posts in our category, - # so with len(blog) instead of the latter we have some buffer - while len(cache) > len(blog): + while len(cache) > 100: cache.remove(cache[0]) # set new cache event