From 58546208c30fdd9ddef1639290b8ba95eecf43f6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 10 Apr 2024 23:53:04 +0200 Subject: [PATCH] Continued: - cache blacklist function invocations --- fba/helpers/blacklist.py | 3 +++ 1 file changed, 3 insertions(+) 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) -- 2.39.5