]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Wed, 10 Apr 2024 21:53:04 +0000 (23:53 +0200)
committerRoland Häder <roland@mxchange.org>
Wed, 10 Apr 2024 21:53:04 +0000 (23:53 +0200)
- cache blacklist function invocations

fba/helpers/blacklist.py

index 5a27c7ff01c5489ffdc1194a3ffb376eea1241a8..64303574feec5522b175bb3dee8a6130c8e82167 100644 (file)
@@ -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)