diff --git a/inbox.py b/inbox.py index 4845c6548..944148f4b 100644 --- a/inbox.py +++ b/inbox.py @@ -161,7 +161,7 @@ def _updateCachedHashtagSwarm(baseDir: str, nickname: str, domain: str, if modifiedDate: currDate = datetime.datetime.utcnow() timeDiff = currDate - modifiedDate - diffMins = divmod(timeDiff.total_seconds(), 60) + diffMins = int(timeDiff.total_seconds() / 60) if diffMins < 10: # was saved recently, so don't save again # This avoids too much disk I/O diff --git a/webapp_search.py b/webapp_search.py index bd92d26e1..7e8757c9b 100644 --- a/webapp_search.py +++ b/webapp_search.py @@ -432,6 +432,13 @@ def htmlSearch(cssCache: {}, translate: {}, pass if not swarmStr: swarmStr = htmlHashTagSwarm(baseDir, actor, translate) + if swarmStr: + try: + with open(cachedHashtagSwarmFilename, 'w+') as fp: + fp.write(swarmStr) + except BaseException: + print('WARN: Unable to save cached hashtag swarm') + pass followStr += '
\n' followStr += ' \n'