Skip to content
Snippets Groups Projects
Commit c055c72b authored by Martin van Es's avatar Martin van Es
Browse files

Better terms for sign/request and cache

parent e7f1dee5
No related branches found
No related tags found
No related merge requests found
...@@ -36,7 +36,7 @@ def serve(domain, eid): ...@@ -36,7 +36,7 @@ def serve(domain, eid):
cached[domain] = cached.get(domain, {}) cached[domain] = cached.get(domain, {})
if entityID in cached[domain]: if entityID in cached[domain]:
if cached[domain][entityID].expires > datetime.now(tz.tzutc()): if cached[domain][entityID].expires > datetime.now(tz.tzutc()):
print(f"serve {entityID}") print(f"cache {entityID}")
return cached[domain][entityID].md return cached[domain][entityID].md
print(f"request {entityID}") print(f"request {entityID}")
......
...@@ -140,6 +140,7 @@ class Resource: ...@@ -140,6 +140,7 @@ class Resource:
if sha1 in self.__dict__: if sha1 in self.__dict__:
signed_entity = self.__dict__[sha1] signed_entity = self.__dict__[sha1]
if signed_entity.expires > datetime.now(tz.tzutc()): if signed_entity.expires > datetime.now(tz.tzutc()):
print(f"cache {sha1}")
data = self.__dict__[sha1].md data = self.__dict__[sha1].md
if data is None and sha1 in self.idps: if data is None and sha1 in self.idps:
...@@ -162,5 +163,4 @@ class Resource: ...@@ -162,5 +163,4 @@ class Resource:
print(sha1) print(sha1)
print(f" {e}") print(f" {e}")
print(f"serve {sha1}")
return data return data
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment