Skip to content
This repository was archived by the owner on Nov 17, 2020. It is now read-only.

Commit 36e734f

Browse files
Extract a constant
1 parent 6cb4eac commit 36e734f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/rabbit_auth_backend_ldap.erl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
-define(SCRUBBED_CREDENTIAL, "xxxx").
3939
-define(RESOURCE_ACCESS_QUERY_VARIABLES, [username, user_dn, vhost, resource, name, permission]).
4040

41+
-define(LDAP_OPERATION_RETRIES, 10).
42+
4143
-import(rabbit_misc, [pget/2]).
4244

4345
-record(impl, { user_dn, password }).
@@ -476,7 +478,7 @@ with_ldap({ok, Creds}, Fun, Servers) ->
476478
end, reuse).
477479

478480
with_login(Creds, Servers, Opts, Fun) ->
479-
with_login(Creds, Servers, Opts, Fun, 5).
481+
with_login(Creds, Servers, Opts, Fun, ?LDAP_OPERATION_RETRIES).
480482
with_login(_Creds, _Servers, _Opts, _Fun, 0 = _RetriesLeft) ->
481483
?L1("failed to perform an LDAP operation: exhausted all retries", []),
482484
{error, ldap_connect_error};

0 commit comments

Comments
 (0)