Check that index exists

merge-requests/30/head
Bob Mottram 2019-11-24 23:52:29 +00:00
parent 4213a1981a
commit 7ffc14e0fb
1 changed files with 4 additions and 2 deletions

View File

@ -465,8 +465,10 @@ def removePostFromCache(postJsonObject: {},recentPostsCache: {}):
if postId not in recentPostsCache['index']: if postId not in recentPostsCache['index']:
return return
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]
recentPostsCache['index'].remove(postId) recentPostsCache['index'].remove(postId)
def updateRecentPostsCache(recentPostsCache: {},maxRecentPosts: int, \ def updateRecentPostsCache(recentPostsCache: {},maxRecentPosts: int, \