From 933aa7a1b8c4b2b786b19340b46b40eb9a783edb Mon Sep 17 00:00:00 2001 From: "Richard Kuo (Danswer)" Date: Fri, 22 Nov 2024 17:29:30 -0800 Subject: [PATCH 1/2] add minimal retries to confluence probe --- backend/danswer/connectors/confluence/onyx_confluence.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/danswer/connectors/confluence/onyx_confluence.py b/backend/danswer/connectors/confluence/onyx_confluence.py index 739e4aef21d..e8c7b13a639 100644 --- a/backend/danswer/connectors/confluence/onyx_confluence.py +++ b/backend/danswer/connectors/confluence/onyx_confluence.py @@ -300,6 +300,9 @@ def _validate_connector_configuration( username=credentials["confluence_username"] if is_cloud else None, password=credentials["confluence_access_token"] if is_cloud else None, token=credentials["confluence_access_token"] if not is_cloud else None, + backoff_and_retry=True, + max_backoff_retries=6, + max_backoff_seconds=10, ) spaces = confluence_client_without_retries.get_all_spaces(limit=1) From 7afb27a4600aa6f717c1ad6ffab2069faf1525bb Mon Sep 17 00:00:00 2001 From: "Richard Kuo (Danswer)" Date: Fri, 22 Nov 2024 17:30:29 -0800 Subject: [PATCH 2/2] name variable correctly --- backend/danswer/connectors/confluence/onyx_confluence.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/danswer/connectors/confluence/onyx_confluence.py b/backend/danswer/connectors/confluence/onyx_confluence.py index e8c7b13a639..8b4ec81ef8b 100644 --- a/backend/danswer/connectors/confluence/onyx_confluence.py +++ b/backend/danswer/connectors/confluence/onyx_confluence.py @@ -294,7 +294,7 @@ def _validate_connector_configuration( wiki_base: str, ) -> None: # test connection with direct client, no retries - confluence_client_without_retries = Confluence( + confluence_client_with_minimal_retries = Confluence( api_version="cloud" if is_cloud else "latest", url=wiki_base.rstrip("/"), username=credentials["confluence_username"] if is_cloud else None, @@ -304,7 +304,7 @@ def _validate_connector_configuration( max_backoff_retries=6, max_backoff_seconds=10, ) - spaces = confluence_client_without_retries.get_all_spaces(limit=1) + spaces = confluence_client_with_minimal_retries.get_all_spaces(limit=1) if not spaces: raise RuntimeError(