From 28538b63da8cf799c239a6eb48ca86c0006b9f44 Mon Sep 17 00:00:00 2001 From: lebaudantoine Date: Tue, 25 Mar 2025 15:25:50 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8(backend)=20add=20env=20variable=20to?= =?UTF-8?q?=20configure=20marketing=20service=20timeout?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change allows the marketing service timeout to be easily adjusted via an environment variable, eliminating the need for a new software release. Additionally, the update makes the code more explicit and easier to maintain. --- src/backend/core/authentication/backends.py | 4 +++- src/backend/meet/settings.py | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/backend/core/authentication/backends.py b/src/backend/core/authentication/backends.py index 71c6d21a..2f8a3866 100644 --- a/src/backend/core/authentication/backends.py +++ b/src/backend/core/authentication/backends.py @@ -121,7 +121,9 @@ class OIDCAuthenticationBackend(MozillaOIDCAuthenticationBackend): contact_data = ContactData( email=email, attributes={"VISIO_SOURCE": ["SIGNIN"]} ) - marketing_service.create_contact(contact_data, timeout=1) + marketing_service.create_contact( + contact_data, timeout=settings.BREVO_API_TIMEOUT + ) except (ContactCreationError, ImproperlyConfigured, ImportError): pass diff --git a/src/backend/meet/settings.py b/src/backend/meet/settings.py index 3d32dac2..680d2724 100755 --- a/src/backend/meet/settings.py +++ b/src/backend/meet/settings.py @@ -498,6 +498,9 @@ class Base(Configuration): converter=lambda x: int(x), # pylint: disable=unnecessary-lambda ) BREVO_API_CONTACT_ATTRIBUTES = values.DictValue({"VISIO_USER": True}) + BREVO_API_TIMEOUT = values.PositiveIntegerValue( + 1, environ_name="BREVO_API_TIMEOUT", environ_prefix=None + ) # Lobby configurations LOBBY_KEY_PREFIX = values.Value(