-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connections breakdowns #128
Conversation
/// <summary> | ||
/// Checks the LDAP exception and throws an appropriate custom exception based on the error code. | ||
/// </summary> | ||
/// <param name="ldapException">The LDAP exception to check.</param> | ||
private static void CheckAndThrowException(LdapException ldapException) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know that I've actually done anything useful to the legibility of CheckAndThrowException
I think I was just looking for an excuse to use a switch statement 🤷
@@ -1498,7 +1525,6 @@ private string ResolveDomainToFullName(string domain) | |||
/// <param name="authType">Auth type to use. Defaults to Kerberos. Use Negotiate for netonly/cross trust(forest) scenarios</param> | |||
/// <param name="globalCatalog">Use global catalog or not</param> | |||
/// <returns>A connected LDAP connection or null</returns> | |||
|
|||
private async Task<LdapConnectionWrapper> CreateLDAPConnectionWrapper(string domainName = null, bool skipCache = false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CreateLDAPConnectionWrapper
is still a bit of a monolith, I'll want to iterate this one again.
return true; | ||
} | ||
|
||
private void HandleBusyException(ref int retryCount, ref TimeSpan backoffDelay) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not the biggest fan of using refs. Will iterate this and try to remove, but for now I think the current design is simple enough to justify their use here.
} | ||
|
||
CheckAndThrowException(connectionResult.Exception); | ||
return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per our new strategy, I should switch this to return a bool and out var
Description
A first pass at breaking down monolithic DC connection methods in LDAPUtils
Motivation and Context
Hopefully makes things more legible, testable and maintainable.
How Has This Been Tested?
Will be tested locally
Screenshots (if appropriate):
Types of changes
Checklist: