MCPcopy Create free account
hub / github.com/internetarchive/openlibrary / decorator

Function decorator

scripts/monitoring/utils.py:80–89  ·  view source on GitHub ↗
(func)

Source from the content-addressed store, hash-verified

78 """
79
80 def decorator(func):
81 hostname = os.environ.get("HOSTNAME")
82 assert hostname
83 server = hostname
84 if hostname.endswith(".us.archive.org"):
85 server = hostname.split(".")[0]
86
87 if not any(fnmatch.fnmatch(server, pattern) for pattern in allowed_servers):
88 scheduler.remove_job(func.__name__)
89 return func
90
91 return decorator

Callers

nothing calls this directly

Calls 2

anyClass · 0.85
getMethod · 0.45

Tested by

no test coverage detected