Remove cached json for muted announce

merge-requests/30/head
Bob Mottram 2021-09-28 16:48:14 +01:00
parent d3e341b594
commit 29ac6e95ff
1 changed files with 21 additions and 8 deletions

View File

@ -554,10 +554,16 @@ def mutePost(baseDir: str, nickname: str, domain: str, port: int,
if recentPostsCache['html'].get(postId): if recentPostsCache['html'].get(postId):
del recentPostsCache['html'][postId] del recentPostsCache['html'][postId]
print('MUTE: ' + postId + ' removed cached html') print('MUTE: ' + postId + ' removed cached html')
if alsoUpdatePostId and recentPostsCache.get('html'):
if recentPostsCache['html'].get(alsoUpdatePostId): if alsoUpdatePostId:
del recentPostsCache['html'][alsoUpdatePostId] if recentPostsCache.get('json'):
print('MUTE: ' + alsoUpdatePostId + ' removed referenced html') if recentPostsCache['json'].get(alsoUpdatePostId):
del recentPostsCache['json'][alsoUpdatePostId]
print('MUTE: ' + alsoUpdatePostId + ' removed referenced json')
if recentPostsCache.get('html'):
if recentPostsCache['html'].get(alsoUpdatePostId):
del recentPostsCache['html'][alsoUpdatePostId]
print('MUTE: ' + alsoUpdatePostId + ' removed referenced html')
def unmutePost(baseDir: str, nickname: str, domain: str, port: int, def unmutePost(baseDir: str, nickname: str, domain: str, port: int,
@ -642,10 +648,17 @@ def unmutePost(baseDir: str, nickname: str, domain: str, port: int,
if recentPostsCache['html'].get(postId): if recentPostsCache['html'].get(postId):
del recentPostsCache['html'][postId] del recentPostsCache['html'][postId]
print('UNMUTE: ' + postId + ' removed cached html') print('UNMUTE: ' + postId + ' removed cached html')
if alsoUpdatePostId and recentPostsCache.get('html'): if alsoUpdatePostId:
if recentPostsCache['html'].get(alsoUpdatePostId): if recentPostsCache.get('json'):
del recentPostsCache['html'][alsoUpdatePostId] if recentPostsCache['json'].get(alsoUpdatePostId):
print('MUTE: ' + alsoUpdatePostId + ' removed referenced html') del recentPostsCache['json'][alsoUpdatePostId]
print('UNMUTE: ' +
alsoUpdatePostId + ' removed referenced json')
if recentPostsCache.get('html'):
if recentPostsCache['html'].get(alsoUpdatePostId):
del recentPostsCache['html'][alsoUpdatePostId]
print('UNMUTE: ' +
alsoUpdatePostId + ' removed referenced html')
def outboxMute(baseDir: str, httpPrefix: str, def outboxMute(baseDir: str, httpPrefix: str,