Fix cache TTL issues

This commit is contained in:
Dylan 2023-07-02 17:23:39 +01:00
parent 0b0c522f5b
commit 828dbdca04

View File

@ -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'])