Skip to content
Snippets Groups Projects
Commit adbb68a7 authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

MAINT: clear cache when necessary

parent e9d7673e
No related branches found
No related tags found
2 merge requests!123REL: Release v0.6.0,!115Use cached_get_entity_by
Pipeline #36289 failed
......@@ -38,7 +38,7 @@ import logging
import os
import sys
import uuid
from caosdb.cached import cached_get_entity_by
from caosdb.cached import cached_get_entity_by, cache_clear
import warnings
import yaml
......@@ -847,6 +847,7 @@ class Crawler(object):
logger.info(f"Going to insert {len(to_be_inserted)} Entities and update "
f"{len(to_be_updated)} Entities.")
if commit_changes:
cache_clear()
self.execute_parent_updates_in_list(to_be_updated, securityMode=self.securityMode,
run_id=self.run_id, unique_names=unique_names)
logger.info(f"Added parent RecordTypes where necessary.")
......
......@@ -46,7 +46,7 @@ from os.path import join, dirname, basename
import yaml
import caosdb as db
from caosdb.apiutils import compare_entities
from caosdb.cached import cache_clear
import pytest
from pytest import raises
......@@ -76,6 +76,11 @@ def dircheckstr(*pathcomponents):
"test_directories", "examples_article", *pathcomponents))
@pytest.fixture
def clear_cache(autouse=True):
cache_clear()
@pytest.fixture
def crawler():
crawler = Crawler()
......
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