Fix cache filename

merge-requests/30/head
Bob Mottram 2020-10-18 20:41:18 +01:00
parent 0bbede6a83
commit dcf34cd3c2
1 changed files with 2 additions and 2 deletions

View File

@ -591,14 +591,14 @@ def clearFromPostCaches(baseDir: str, postId: str) -> None:
"""Clears cached html for the given post, so that edits """Clears cached html for the given post, so that edits
to news will appear to news will appear
""" """
filename = postId + '.html' filename = '/postcache/' + postId + '.html'
for subdir, dirs, files in os.walk(baseDir + '/accounts'): for subdir, dirs, files in os.walk(baseDir + '/accounts'):
for acct in dirs: for acct in dirs:
if '@' not in acct: if '@' not in acct:
continue continue
if 'inbox@' in acct: if 'inbox@' in acct:
continue continue
cacheDir = os.path.join(baseDir + '/accounts/postcache', acct) cacheDir = os.path.join(baseDir + '/accounts', acct)
postFilename = cacheDir + filename postFilename = cacheDir + filename
print('clearFromPostCaches: ' + postFilename) print('clearFromPostCaches: ' + postFilename)
if os.path.isfile(postFilename): if os.path.isfile(postFilename):