Remove question from post cache

merge-requests/6/head
Bob Mottram 2019-11-25 13:48:07 +00:00
parent e2a9814ef9
commit ffe23ce23d
1 changed files with 11 additions and 0 deletions

View File

@ -221,6 +221,17 @@ class PubServer(BaseHTTPRequestHandler):
if votesFile:
votesFile.write(messageId+'\n')
votesFile.close()
# ensure that the cached post is removed if it exists, so
# that it then will be recreated
cachedPostFilename= \
getCachedPostFilename(self.server.baseDir, \
nickname, \
self.server.domain,messageJson)
if os.path.isfile(cachedPostFilename):
os.remove(cachedPostFilename)
# remove from memory cache
removePostFromCache(messageJson,self.server.recentPostsCache)
else:
print('ERROR: unable to post vote to outbox')
else: