Skip to content

Commit

Permalink
Merge pull request #11114 from hustxiaoc/patch-1
Browse files Browse the repository at this point in the history
Better for service discovery
  • Loading branch information
vkarpov15 committed Dec 20, 2021
2 parents a0712da + f361220 commit c072e57
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -1359,7 +1359,7 @@ Connection.prototype.setClient = function setClient(client) {
if (!(client instanceof mongodb.MongoClient)) {
throw new MongooseError('Must call `setClient()` with an instance of MongoClient');
}
if (this.client != null || this.readyState !== STATES.disconnected) {
if (this.readyState !== STATES.disconnected) {
throw new MongooseError('Cannot call `setClient()` on a connection that is already connected.');
}
if (client.topology == null) {
Expand Down

0 comments on commit c072e57

Please sign in to comment.