Skip to content

Commit

Permalink
chore: more comment
Browse files Browse the repository at this point in the history
  • Loading branch information
rvazarkar committed Feb 2, 2024
1 parent 514a27c commit e12785f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/CommonLib/LDAPUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,9 @@ public IEnumerable<ISearchResultEntry> QueryLDAP(string ldapFilter, SearchScope
while the other threads that hit the ServerDown exception simply wait. The initial caller will hold the semaphore
and do a backoff delay before trying to make a new connection which will replace the existing connection in the
_ldapConnections cache. Other threads will retrieve the new connection from the cache instead of making a new one
This minimizes overhead of new connections while still fixing our core problem*/
This minimizes overhead of new connections while still fixing our core problem.
A CurrentCount of 0 indicates the semaphore is already held because c# semaphores are weird and backwards*/
var isSemaphoreHeld = _semaphoreSlim.CurrentCount == 0;
//Always increment retry count
retryCount++;
Expand Down

0 comments on commit e12785f

Please sign in to comment.