Changeset View
Changeset View
Standalone View
Standalone View
swh/indexer/indexer.py
Show First 20 Lines • Show All 152 Lines • ▼ Show 20 Lines | def prepare(self) -> None: | ||||
"""Prepare the indexer's needed runtime configuration. | """Prepare the indexer's needed runtime configuration. | ||||
Without this step, the indexer cannot possibly run. | Without this step, the indexer cannot possibly run. | ||||
""" | """ | ||||
config_storage = self.config.get("storage") | config_storage = self.config.get("storage") | ||||
if config_storage: | if config_storage: | ||||
self.storage = get_storage(**config_storage) | self.storage = get_storage(**config_storage) | ||||
objstorage = self.config["objstorage"] | self.objstorage = get_objstorage(**self.config["objstorage"]) | ||||
self.objstorage = get_objstorage(objstorage["cls"], objstorage["args"]) | |||||
idx_storage = self.config[INDEXER_CFG_KEY] | idx_storage = self.config[INDEXER_CFG_KEY] | ||||
self.idx_storage = get_indexer_storage(**idx_storage) | self.idx_storage = get_indexer_storage(**idx_storage) | ||||
_log = logging.getLogger("requests.packages.urllib3.connectionpool") | _log = logging.getLogger("requests.packages.urllib3.connectionpool") | ||||
_log.setLevel(logging.WARN) | _log.setLevel(logging.WARN) | ||||
self.log = logging.getLogger("swh.indexer") | self.log = logging.getLogger("swh.indexer") | ||||
▲ Show 20 Lines • Show All 444 Lines • Show Last 20 Lines |