From 450322fff16432cab6eb33cd5e64a915dd1cf0e3 Mon Sep 17 00:00:00 2001 From: Carlos Quintana <74399022+cquintana92@users.noreply.github.com> Date: Thu, 23 May 2024 16:50:54 +0200 Subject: [PATCH] feat: allow to disable event-webhook (#2118) --- app/config.py | 1 + app/events/event_dispatcher.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/app/config.py b/app/config.py index 4513d60d..325b475f 100644 --- a/app/config.py +++ b/app/config.py @@ -586,3 +586,4 @@ EVENT_WEBHOOK = os.environ.get("EVENT_WEBHOOK", None) # We want it disabled by default, so only skip if defined EVENT_WEBHOOK_SKIP_VERIFY_SSL = "EVENT_WEBHOOK_SKIP_VERIFY_SSL" in os.environ +EVENT_WEBHOOK_DISABLE = "EVENT_WEBHOOK_DISABLE" in os.environ diff --git a/app/events/event_dispatcher.py b/app/events/event_dispatcher.py index c62bf425..af30d330 100644 --- a/app/events/event_dispatcher.py +++ b/app/events/event_dispatcher.py @@ -34,6 +34,9 @@ class EventDispatcher: dispatcher: Dispatcher = PostgresDispatcher.get(), skip_if_webhook_missing: bool = True, ): + if config.EVENT_WEBHOOK_DISABLE: + return + if not config.EVENT_WEBHOOK and skip_if_webhook_missing: return