From e6a63309bc25245d721a29dc7d29a9b4a1776cc4 Mon Sep 17 00:00:00 2001 From: Jorrit Schaap <schaap@astron.nl> Date: Thu, 15 Jul 2021 16:00:51 +0200 Subject: [PATCH] TMSS-849: use cache for faster validation --- SAS/TMSS/backend/src/tmss/tmssapp/models/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/models/common.py b/SAS/TMSS/backend/src/tmss/tmssapp/models/common.py index 834f7bbcdb9..75b834097b4 100644 --- a/SAS/TMSS/backend/src/tmss/tmssapp/models/common.py +++ b/SAS/TMSS/backend/src/tmss/tmssapp/models/common.py @@ -195,7 +195,7 @@ class Template(NamedVersionedCommon): 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. - 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: '''validate the given json_doc against the template's schema -- GitLab