mirror of https://gitlab.com/bashrc2/epicyon
Minutes difference
parent
b4e4159e8b
commit
732b8efc97
2
inbox.py
2
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
|
||||
|
|
|
@ -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 += ' <p class="hashtagswarm">' + swarmStr + '</p>\n'
|
||||
followStr += ' </center>\n'
|
||||
|
|
Loading…
Reference in New Issue