Commit bbf946db authored by Pierre Dittgen's avatar Pierre Dittgen
Browse files

Improve catalog retrieving speed

parent f4389430
......@@ -32,10 +32,18 @@ from .validata_util import strip_accents
log = logging.getLogger(__name__)
schema_catalog_updater: Dict[str, ThreadUpdater] = {}
def get_schema_catalog(section_name):
"""Return a schema catalog associated to a section_name."""
return schema_catalog_registry.build_schema_catalog(section_name)
global schema_catalog_updater
if section_name not in schema_catalog_updater:
schema_catalog_updater[section_name] = ThreadUpdater(
lambda: schema_catalog_registry.build_schema_catalog(section_name)
)
return schema_catalog_updater[section_name].value
class SchemaInstance:
......@@ -43,6 +51,7 @@ class SchemaInstance:
def __init__(self, parameter_dict):
"""Initialize schema instance and tableschema catalog."""
self.section_name = None
self.section_title = None
self.name = None
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment