mirror of https://gitlab.com/bashrc2/epicyon
Check that cache entry exists before deleting
parent
8b8af40c64
commit
abf822abac
6
utils.py
6
utils.py
|
@ -1546,8 +1546,10 @@ def updateRecentPostsCache(recentPostsCache: {}, maxRecentPosts: int,
|
||||||
while len(recentPostsCache['html'].items()) > maxRecentPosts:
|
while len(recentPostsCache['html'].items()) > maxRecentPosts:
|
||||||
postId = recentPostsCache['index'][0]
|
postId = recentPostsCache['index'][0]
|
||||||
recentPostsCache['index'].pop(0)
|
recentPostsCache['index'].pop(0)
|
||||||
del recentPostsCache['json'][postId]
|
if recentPostsCache['json'].get(postId):
|
||||||
del recentPostsCache['html'][postId]
|
del recentPostsCache['json'][postId]
|
||||||
|
if recentPostsCache['html'].get(postId):
|
||||||
|
del recentPostsCache['html'][postId]
|
||||||
else:
|
else:
|
||||||
recentPostsCache['index'] = [postId]
|
recentPostsCache['index'] = [postId]
|
||||||
recentPostsCache['json'] = {}
|
recentPostsCache['json'] = {}
|
||||||
|
|
Loading…
Reference in New Issue