Skip to content

Commit

Permalink
feat: allow to disable event-webhook
Browse files Browse the repository at this point in the history
  • Loading branch information
cquintana92 committed May 23, 2024
1 parent aad6f59 commit 7741598
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,3 +586,4 @@ def getRateLimitFromConfig(

# 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
3 changes: 3 additions & 0 deletions app/events/event_dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ def send_event(
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

Expand Down

0 comments on commit 7741598

Please sign in to comment.