Skip to content

Commit eaba46b

Browse files
authored
Merge pull request #100 from bgeo-gis/clear-request-cache
Clear internal capabilities cache for every request
2 parents fc3ebf8 + db3fcdb commit eaba46b

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/config_generator/external_layer_utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
capabilites_cache = ExpiringDict()
88

9+
def clear_capabilities_cache():
10+
global capabilites_cache
11+
capabilites_cache.cache = {}
912

1013
def getChildElement(parent, path):
1114
for part in path.split("/"):

src/config_generator/map_viewer_config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import traceback
99
import urllib.parse
1010

11-
from .external_layer_utils import resolve_external_layer
11+
from .external_layer_utils import resolve_external_layer, clear_capabilities_cache
1212
from .permissions_query import PermissionsQuery
1313
from .service_config import ServiceConfig
1414

@@ -89,6 +89,8 @@ def __init__(self, tenant_path, generator_config, themes_reader,
8989
"""
9090
super().__init__('mapViewer', schema_url, service_config, logger)
9191

92+
clear_capabilities_cache()
93+
9294
self.tenant_path = tenant_path
9395
self.themes_reader = themes_reader
9496
self.config_models = config_models

0 commit comments

Comments
 (0)