Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Validata
Validata UI
Commits
bbf946db
Commit
bbf946db
authored
Nov 19, 2021
by
Pierre Dittgen
Browse files
Improve catalog retrieving speed
parent
f4389430
Changes
1
Hide whitespace changes
Inline
Side-by-side
validata_ui/views.py
View file @
bbf946db
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment