From a99063bb64743c5d8e9263c2a5c26bd004898477 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 10 Nov 2020 15:23:30 +0000 Subject: [PATCH] Get css from cache --- daemon.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/daemon.py b/daemon.py index 01ac5c90..6e8765c3 100644 --- a/daemon.py +++ b/daemon.py @@ -166,6 +166,7 @@ from shares import getSharesFeedForPerson from shares import addShare from shares import removeShare from shares import expireShares +from utils import getCSS from utils import firstParagraphFromString from utils import clearFromPostCaches from utils import containsInvalidChars @@ -8279,8 +8280,9 @@ class PubServer(BaseHTTPRequestHandler): tries = 0 while tries < 5: try: - with open(path, 'r') as cssfile: - css = cssfile.read() + css = getCSS(self.server.baseDir, path, + self.server.cssCache) + if css: break except Exception as e: print(e)