refactor(db): guard connexct statement instead
This commit is contained in:
parent
529120e936
commit
27f476a8a7
@ -14,4 +14,4 @@ export const olduri =
|
|||||||
? `mongodb://127.0.0.1/rockfic_old?authSource=admin`
|
? `mongodb://127.0.0.1/rockfic_old?authSource=admin`
|
||||||
: `mongodb://${process.env.DBUSER}:${process.env.DBPASS}@127.0.0.1:27017/rockfic_old?authSource=admin`;
|
: `mongodb://${process.env.DBUSER}:${process.env.DBPASS}@127.0.0.1:27017/rockfic_old?authSource=admin`;
|
||||||
|
|
||||||
mongoose.connect(uri);
|
!mongoose.connection.modelNames().length && mongoose.connect(uri);
|
||||||
|
Loading…
Reference in New Issue
Block a user