From 4eb8d7e31309f38decd8f3db690b082ad57b4b0c Mon Sep 17 00:00:00 2001 From: Mike Pond <32133001+P0NDER0SA@users.noreply.github.com> Date: Thu, 22 Aug 2024 10:43:59 -0400 Subject: [PATCH] updating code to use booleans rather than 'true''false' (#2262) --- app/celery/celery.py | 2 +- app/config.py | 2 +- application.py | 2 +- run_celery.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/celery/celery.py b/app/celery/celery.py index 31b0297618..2a47530ed4 100644 --- a/app/celery/celery.py +++ b/app/celery/celery.py @@ -49,7 +49,7 @@ def init_app(self, app): task_cls=make_task(app), ) - if app.config["AWS_XRAY_ENABLED"] == "true": + if app.config["AWS_XRAY_ENABLED"]: # Register the xray handlers signals.after_task_publish.connect(xray_after_task_publish) signals.before_task_publish.connect(xray_before_task_publish) diff --git a/app/config.py b/app/config.py index 9d2885dfb9..208c8456a7 100644 --- a/app/config.py +++ b/app/config.py @@ -241,7 +241,7 @@ class Config(object): NOTIFY_LOG_PATH = os.getenv("NOTIFY_LOG_PATH") # AWS Xray - AWS_XRAY_ENABLED = os.getenv("AWS_XRAY_ENABLED", "false") + AWS_XRAY_ENABLED = env.bool("AWS_XRAY_ENABLED", False) # Cronitor CRONITOR_ENABLED = False diff --git a/application.py b/application.py index 07553cb347..43e79ab1cb 100644 --- a/application.py +++ b/application.py @@ -20,7 +20,7 @@ app = create_app(application) -if app.config["AWS_XRAY_ENABLED"] == "true": +if app.config["AWS_XRAY_ENABLED"]: xray_recorder.configure(service='api') XRayMiddleware(app, xray_recorder) diff --git a/run_celery.py b/run_celery.py index 635b5653c8..416c8f1864 100644 --- a/run_celery.py +++ b/run_celery.py @@ -15,7 +15,7 @@ application = Flask("celery") create_app(application) -if application.config["AWS_XRAY_ENABLED"] == "true": +if application.config["AWS_XRAY_ENABLED"]: xray_recorder.configure(service='celery') XRayMiddleware(application, xray_recorder)