mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
fix: verify sentry config before starting
This commit is contained in:
parent
b1743df9f2
commit
74ccbc5738
1 changed files with 13 additions and 5 deletions
|
|
@ -103,6 +103,9 @@ def get_learnhouse_config() -> LearnHouseConfig:
|
||||||
'database_config', {}).get('mongodb_connection_string')
|
'database_config', {}).get('mongodb_connection_string')
|
||||||
|
|
||||||
# Sentry config
|
# Sentry config
|
||||||
|
# check if the sentry config is provided in the YAML file
|
||||||
|
sentry_config_verif = yaml_config.get('hosting_config', {}).get('sentry_config') or env_sentry_dsn or env_sentry_environment or env_sentry_release or None
|
||||||
|
|
||||||
sentry_dsn = env_sentry_dsn or yaml_config.get(
|
sentry_dsn = env_sentry_dsn or yaml_config.get(
|
||||||
'hosting_config', {}).get('sentry_config', {}).get('dsn')
|
'hosting_config', {}).get('sentry_config', {}).get('dsn')
|
||||||
sentry_environment = env_sentry_environment or yaml_config.get(
|
sentry_environment = env_sentry_environment or yaml_config.get(
|
||||||
|
|
@ -110,11 +113,16 @@ def get_learnhouse_config() -> LearnHouseConfig:
|
||||||
sentry_release = env_sentry_release or yaml_config.get(
|
sentry_release = env_sentry_release or yaml_config.get(
|
||||||
'hosting_config', {}).get('sentry_config', {}).get('release')
|
'hosting_config', {}).get('sentry_config', {}).get('release')
|
||||||
|
|
||||||
sentry_config = SentryConfig(
|
if sentry_config_verif:
|
||||||
dsn=sentry_dsn,
|
sentry_config = SentryConfig(
|
||||||
environment=sentry_environment,
|
dsn=sentry_dsn,
|
||||||
release=sentry_release
|
environment=sentry_environment,
|
||||||
)
|
release=sentry_release
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
sentry_config = None
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Create HostingConfig and DatabaseConfig objects
|
# Create HostingConfig and DatabaseConfig objects
|
||||||
hosting_config = HostingConfig(
|
hosting_config = HostingConfig(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue