Remove the global _LAZY_LOADED_MODULES and allow each instance of ArchivingOrchestrator to load its own modules

This commit is contained in:
Patrick Robertson
2025-02-19 12:25:35 +00:00
parent eb60b271b9
commit a9802dd004
14 changed files with 203 additions and 183 deletions

View File

@@ -10,7 +10,6 @@ from auto_archiver.version import __version__
from auto_archiver.core import Metadata, Media
from auto_archiver.core import Formatter
from auto_archiver.utils.misc import random_str
from auto_archiver.core.module import get_module
class HtmlFormatter(Formatter):
environment: Environment = None
@@ -50,7 +49,7 @@ class HtmlFormatter(Formatter):
final_media = Media(filename=html_path, _mimetype="text/html")
# get the already instantiated hash_enricher module
he = get_module('hash_enricher', self.config)
he = self.module_factory.get_module('hash_enricher', self.config)
if len(hd := he.calculate_hash(final_media.filename)):
final_media.set("hash", f"{he.algorithm}:{hd}")