Skip to content
Snippets Groups Projects
Commit e6a63309 authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

TMSS-849: use cache for faster validation

parent 09e69e67
No related branches found
No related tags found
3 merge requests!634WIP: COBALT commissioning delta,!513TMSS-849,!481Draft: SW-971 SW-973 SW-975: Various fixes to build LOFAR correctly.
...@@ -195,7 +195,7 @@ class Template(NamedVersionedCommon): ...@@ -195,7 +195,7 @@ class Template(NamedVersionedCommon):
logger.error("Could not override schema $id with auto-generated url: %s", e) logger.error("Could not override schema $id with auto-generated url: %s", e)
# this template's schema has a schema of its own (usually the draft-06 meta schema). Validate it. # this template's schema has a schema of its own (usually the draft-06 meta schema). Validate it.
validate_json_against_its_schema(self.schema) validate_json_against_its_schema(self.schema, cache=TemplateSchemaMixin._schema_cache, max_cache_age=TemplateSchemaMixin._MAX_SCHEMA_CACHE_AGE)
def validate_document(self, json_doc: typing.Union[str, dict]) -> bool: def validate_document(self, json_doc: typing.Union[str, dict]) -> bool:
'''validate the given json_doc against the template's schema '''validate the given json_doc against the template's schema
......
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