From 05540280d87cfac3342e0c2d6860648230234c09 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 31 May 2020 13:10:50 +0100 Subject: [PATCH] Check if hashtag index was modified today --- webinterface.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/webinterface.py b/webinterface.py index 7a87716fe..c3de636b2 100644 --- a/webinterface.py +++ b/webinterface.py @@ -5739,12 +5739,17 @@ def htmlHashTagSwarm(baseDir: str, actor: str) -> str: tagsFilename = os.path.join(baseDir + '/tags', f) if not os.path.isfile(tagsFilename): continue + # get last modified datetime modTimesinceEpoc = os.path.getmtime(tagsFilename) lastModifiedDate = datetime.fromtimestamp(modTimesinceEpoc) fileDaysSinceEpoch = (lastModifiedDate - datetime(1970, 1, 1)).days + # check of the file is too old if fileDaysSinceEpoch < maxDaysSinceEpoch: removeHashtags.append(tagsFilename) continue + # check if the file was last modified today + if fileDaysSinceEpoch != daysSinceEpoch: + continue hashTagName = f.split('.')[0] if isBlockedHashtag(baseDir, hashTagName):