Removing old posts from cache

merge-requests/8/head
Bob Mottram 2020-08-26 13:42:17 +01:00
parent 593893206c
commit 3b7bc19dba
1 changed files with 1 additions and 0 deletions

View File

@ -771,6 +771,7 @@ def updateRecentPostsCache(recentPostsCache: {}, maxRecentPosts: int,
recentPostsCache['html'][postId] = htmlStr recentPostsCache['html'][postId] = htmlStr
while len(recentPostsCache['html'].items()) > maxRecentPosts: while len(recentPostsCache['html'].items()) > maxRecentPosts:
postId = recentPostsCache['index'][0]
recentPostsCache['index'].pop(0) recentPostsCache['index'].pop(0)
del recentPostsCache['json'][postId] del recentPostsCache['json'][postId]
del recentPostsCache['html'][postId] del recentPostsCache['html'][postId]