Skip to content

Commit

Permalink
Merge pull request #222 from xuannghia/master
Browse files Browse the repository at this point in the history
fix connection error if there is more than one service
  • Loading branch information
icebob committed Sep 17, 2020
2 parents f3a3b1e + fc9f569 commit 4bed1af
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 18 deletions.
40 changes: 24 additions & 16 deletions packages/moleculer-db-adapter-mongoose/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/moleculer-db-adapter-mongoose/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"jest-cli": "^26.0.1",
"lolex": "^6.0.0",
"moleculer": "^0.14.7",
"mongoose": "^5.9.18",
"mongoose": "^5.10.5",
"nodemon": "^2.0.4",
"npm-check": "^5.9.2"
},
Expand Down
3 changes: 2 additions & 1 deletion packages/moleculer-db-adapter-mongoose/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ class MongooseDbAdapter {
this.model = conn.model(this.modelName, this.schema);
}

return conn.then(result => {
return conn.then(_result => {
const result = _result || conn
this.conn = conn;

if (result.connection)
Expand Down

0 comments on commit 4bed1af

Please sign in to comment.