From 828dbdca04a932fbd3b98fc93e260d692c605e7a Mon Sep 17 00:00:00 2001 From: Dylan Date: Sun, 2 Jul 2023 17:23:39 +0100 Subject: [PATCH] Fix cache TTL issues --- twitfix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/twitfix.py b/twitfix.py index cd27e3d..c61b84f 100644 --- a/twitfix.py +++ b/twitfix.py @@ -205,7 +205,7 @@ def secondsUntilTTL(ttl): def make_cached_vnf_response(vnf,response): try: - if vnf['ttl'] == None or vnf['ttl'] < datetime.today().replace(microsecond=0) or 'ttl' not in vnf: + if 'ttl' not in vnf or vnf['ttl'] == None or secondsUntilTTL(vnf['ttl']) < datetime.today().replace(microsecond=0): return response resp = make_response(response) resp.cache_control.max_age = secondsUntilTTL(vnf['ttl'])