Skip to content

Commit

Permalink
Wrap generator config in a RuntimeConfig so that config.get(...) hono…
Browse files Browse the repository at this point in the history
…urs environment variable overrides
  • Loading branch information
manisandro committed Dec 11, 2024
1 parent ae1f087 commit d0e6ec5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
flask_login==0.6.3
jsonschema==4.20.0
psycopg2==2.9.9
qwc-services-core==1.3.34
qwc-services-core==1.3.35
requests==2.32.0
SQLAlchemy==2.0.29
Flask==3.0.0
Expand Down
6 changes: 4 additions & 2 deletions src/config_generator/config_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

from qwc_services_core.config_models import ConfigModels
from qwc_services_core.database import DatabaseEngine
from qwc_services_core.runtime_config import RuntimeConfig
from .theme_reader import ThemeReader
from .data_service_config import DataServiceConfig
from .ext_service_config import ExtServiceConfig
Expand Down Expand Up @@ -194,8 +195,9 @@ def __init__(self, config, logger, config_file_dir, use_cached_project_metadata,

self.config = config

# get default QGIS server URL from ConfigGenerator config
generator_config = self.config.get('config', {})
# Note: Wrap generator config in a RuntimeConfig so that config.get(...) honours environment variable overrides
generator_config = RuntimeConfig("configGenerator", self.logger).set_config(config)

self.default_qgis_server_url = generator_config.get(
'default_qgis_server_url', 'http://localhost:8001/ows/'
).rstrip('/') + '/'
Expand Down

0 comments on commit d0e6ec5

Please sign in to comment.