Skip to content

Commit

Permalink
Don't cache get_scitokens_conf_block()
Browse files Browse the repository at this point in the history
care must be taken when caching methods (see https://docs.python.org/3/faq/programming.html#how-do-i-cache-method-calls) and it's not called frequently enough to be worth it.
  • Loading branch information
matyasselmeci committed May 25, 2024
1 parent c4ae64f commit 33b56f7
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/webapp/data_federation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import functools
import re
import urllib
import urllib.parse
Expand Down Expand Up @@ -89,7 +88,6 @@ def __str__(self):
return f"SciToken: issuer={self.issuer} base_path={self.base_path} restricted_path={self.restricted_path} " \
f"map_subject={self.map_subject}"

@functools.lru_cache(4)
def get_scitokens_conf_block(self, service_name: str):
if service_name not in [XROOTD_CACHE_SERVER, XROOTD_ORIGIN_SERVER]:
raise ValueError(f"service_name must be '{XROOTD_CACHE_SERVER}' or '{XROOTD_ORIGIN_SERVER}'")
Expand Down

0 comments on commit 33b56f7

Please sign in to comment.