From: Roland Häder Date: Wed, 10 Apr 2024 21:53:04 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=58546208c30fdd9ddef1639290b8ba95eecf43f6;p=fba.git Continued: - cache blacklist function invocations --- diff --git a/fba/helpers/blacklist.py b/fba/helpers/blacklist.py index 5a27c7f..6430357 100644 --- a/fba/helpers/blacklist.py +++ b/fba/helpers/blacklist.py @@ -16,6 +16,8 @@ import logging +from functools import lru_cache + from fba.helpers import domain as domain_helper logging.basicConfig(level=logging.INFO) @@ -72,6 +74,7 @@ _blacklist = { "github.com" : "GIT repository hosting service", } +@lru_cache def is_blacklisted(domain: str) -> bool: logger.debug("domain='%s' - CALLED!", domain) domain_helper.raise_on(domain)