Try using only the cache for inbox timeline

merge-requests/30/head
Bob Mottram 2021-09-03 10:07:18 +01:00
parent 33578b0842
commit 46b8f60dfc
2 changed files with 9 additions and 2 deletions

View File

@ -1118,7 +1118,8 @@ def individualPostAsHtml(signingPrivateKeyPem: str,
showIcons: bool = False, showIcons: bool = False,
manuallyApprovesFollowers: bool = False, manuallyApprovesFollowers: bool = False,
showPublicOnly: bool = False, showPublicOnly: bool = False,
storeToCache: bool = True) -> str: storeToCache: bool = True,
useCacheOnly: bool = False) -> str:
""" Shows a single post as html """ Shows a single post as html
""" """
if not postJsonObject: if not postJsonObject:
@ -1176,6 +1177,8 @@ def individualPostAsHtml(signingPrivateKeyPem: str,
signingPrivateKeyPem) signingPrivateKeyPem)
if postHtml: if postHtml:
return postHtml return postHtml
if useCacheOnly:
return ''
_logPostTiming(enableTimingLog, postStartTime, '4') _logPostTiming(enableTimingLog, postStartTime, '4')

View File

@ -810,6 +810,10 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
+ boxName + ' ' + str(timelineJson)) + boxName + ' ' + str(timelineJson))
return '' return ''
useCacheOnly = False
if boxName == 'inbox':
useCacheOnly = True
if timelineJson: if timelineJson:
# if this is the media timeline then add an extra gallery container # if this is the media timeline then add an extra gallery container
if boxName == 'tlmedia': if boxName == 'tlmedia':
@ -876,7 +880,7 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
boxName != 'dm', boxName != 'dm',
showIndividualPostIcons, showIndividualPostIcons,
manuallyApproveFollowers, manuallyApproveFollowers,
False, True) False, True, useCacheOnly)
_logTimelineTiming(enableTimingLog, _logTimelineTiming(enableTimingLog,
timelineStartTime, boxName, '12') timelineStartTime, boxName, '12')