-
Notifications
You must be signed in to change notification settings - Fork 1.8k
refactor(NODE-5914): topology.selectServer to async-await #4020
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
Conversation
03a009a
to
7db2f7f
Compare
c533616
to
b9ee91c
Compare
497a29e
to
e033bd5
Compare
…node-mongodb-native into NODE-5914/refactor-selectServer
@@ -883,7 +877,7 @@ function updateServers(topology: Topology, incomingServerDescription?: ServerDes | |||
} | |||
} | |||
|
|||
function drainWaitQueue(queue: List<ServerSelectionRequest>, err?: MongoDriverError) { | |||
function drainWaitQueue(queue: List<ServerSelectionRequest>, drainError: MongoDriverError) { |
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 always appreciate drive-by improvement of variable names, thanks for improving this one!
lack of attention to variable names leads to death of readability by a thousand cuts 🔪
} | ||
return; | ||
} catch (err) { | ||
// are we expecting an error? |
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.
tbh I thought this was intended to be a question for the reviewers 😅
I don't feel strongly but maybe making it a statement instead of a question would be a little more clear
Co-authored-by: Bailey Pearson <[email protected]>
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.
just a formatting lint 🎉
Description
What is changing?
Topology.selectServer
to async/await syntaxTopology.connect
to async/await syntax and add connection lockTopology.selectServer
in the driver includingIs there new documentation needed for these changes?
No
What is the motivation for this change?
NODE-5914
Double check the following
npm run check:lint
scripttype(NODE-xxxx)[!]: description
feat(NODE-1234)!: rewriting everything in coffeescript