This is an automated email from the ASF dual-hosted git repository.

rnewson pushed a commit to branch lucene-10
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit c0d7e0c78175fd1e9f9d4adeed72bf0e2f846c52
Author: Robert Newson <rnew...@apache.org>
AuthorDate: Thu Aug 7 12:14:02 2025 +0100

    retry if no connection available
---
 src/nouveau/src/nouveau_api.erl | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/nouveau/src/nouveau_api.erl b/src/nouveau/src/nouveau_api.erl
index 73aff2c1f..64f5a948a 100644
--- a/src/nouveau/src/nouveau_api.erl
+++ b/src/nouveau/src/nouveau_api.erl
@@ -281,6 +281,9 @@ send_if_enabled(Path, ReqHeaders, Method) ->
     send_if_enabled(Path, ReqHeaders, Method, <<>>).
 
 send_if_enabled(Path, ReqHeaders, Method, ReqBody) ->
+    send_if_enabled(Path, ReqHeaders, Method, ReqBody, 5).
+
+send_if_enabled(Path, ReqHeaders, Method, ReqBody, RemainingTries) ->
     case nouveau:enabled() of
         true ->
             case
@@ -306,6 +309,9 @@ send_if_enabled(Path, ReqHeaders, Method, ReqBody) ->
                         {error, Reason} ->
                             {error, Reason}
                     end;
+                {error, no_connection_available, _Reason} when RemainingTries 
> 0 ->
+                    timer:sleep(1000),
+                    send_if_enabled(Path, ReqHeaders, Method, ReqBody, 
RemainingTries - 1);
                 {error, _Type, Reason} ->
                     {error, Reason}
             end;

Reply via email to