From 46b8f60dfcf183c2379508b8537164c9722571b1 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 3 Sep 2021 10:07:18 +0100 Subject: [PATCH] Try using only the cache for inbox timeline --- webapp_post.py | 5 ++++- webapp_timeline.py | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/webapp_post.py b/webapp_post.py index e17300b0c..be70bf37e 100644 --- a/webapp_post.py +++ b/webapp_post.py @@ -1118,7 +1118,8 @@ def individualPostAsHtml(signingPrivateKeyPem: str, showIcons: bool = False, manuallyApprovesFollowers: bool = False, showPublicOnly: bool = False, - storeToCache: bool = True) -> str: + storeToCache: bool = True, + useCacheOnly: bool = False) -> str: """ Shows a single post as html """ if not postJsonObject: @@ -1176,6 +1177,8 @@ def individualPostAsHtml(signingPrivateKeyPem: str, signingPrivateKeyPem) if postHtml: return postHtml + if useCacheOnly: + return '' _logPostTiming(enableTimingLog, postStartTime, '4') diff --git a/webapp_timeline.py b/webapp_timeline.py index 2bac74ea6..14e1d45d5 100644 --- a/webapp_timeline.py +++ b/webapp_timeline.py @@ -810,6 +810,10 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str, + boxName + ' ' + str(timelineJson)) return '' + useCacheOnly = False + if boxName == 'inbox': + useCacheOnly = True + if timelineJson: # if this is the media timeline then add an extra gallery container if boxName == 'tlmedia': @@ -876,7 +880,7 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str, boxName != 'dm', showIndividualPostIcons, manuallyApproveFollowers, - False, True) + False, True, useCacheOnly) _logTimelineTiming(enableTimingLog, timelineStartTime, boxName, '12')