From ecfc87638c4a906e2c82d2756e2bcbbfd8beca03 Mon Sep 17 00:00:00 2001 From: Lova ANDRIARIMALALA <43842786+Xpirix@users.noreply.github.com> Date: Thu, 23 May 2024 08:48:04 +0300 Subject: [PATCH] Init sentry when the dsn is specified --- qgis-app/settings_docker.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/qgis-app/settings_docker.py b/qgis-app/settings_docker.py index 23290d50..baa1bcd8 100644 --- a/qgis-app/settings_docker.py +++ b/qgis-app/settings_docker.py @@ -165,11 +165,12 @@ # Sentry SENTRY_DSN = os.environ.get("SENTRY_DSN", "") -import sentry_sdk - -sentry_sdk.init( - dsn=SENTRY_DSN, - # Set traces_sample_rate to 1.0 to capture 100% - # of transactions for performance monitoring. - traces_sample_rate=1.0, -) +if SENTRY_DSN and SENTRY_DSN != "": + import sentry_sdk + + sentry_sdk.init( + dsn=SENTRY_DSN, + # Set traces_sample_rate to 1.0 to capture 100% + # of transactions for performance monitoring. + traces_sample_rate=1.0, + )