Skip to content
Snippets Groups Projects
Commit c1a5c92b authored by NolanB's avatar NolanB
Browse files

Move the cache config to method configure_cache

parent 56cdbf31
No related branches found
No related tags found
1 merge request!178Move the cache config to method configure_cache
Pipeline #79300 passed
......@@ -137,6 +137,8 @@ class ElementsWorker(
def configure(self):
super().configure()
super().configure_cache()
# Add report concerning elements
self.report = Reporter(
**self.worker_details, version=getattr(self, "worker_version_id", None)
......
......@@ -211,6 +211,7 @@ class BaseWorker(object):
logger.setLevel(logging.DEBUG)
logger.debug("Debug output enabled")
def configure_cache(self):
task_id = os.environ.get("PONOS_TASK")
paths = None
if self.support_cache and self.args.database is not None:
......
......@@ -286,6 +286,7 @@ def mock_elements_worker_with_cache(monkeypatch, mock_config_api, tmp_path):
worker = ElementsWorker(support_cache=True)
worker.configure()
worker.configure_cache()
return worker
......
......@@ -182,6 +182,7 @@ def test_merge_from_worker(
# Create the task's output dir, so that it can create its own database
(tmpdir / "my_task").mkdir()
mock_base_worker_with_cache.configure()
mock_base_worker_with_cache.configure_cache()
# Then we have 2 elements and a transcription
assert CachedImage.select().count() == 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment