core: fix database connection

This commit is contained in:
undefined committed 2021-03-26 16:43:36 +08:00
1 parent 551cf9c19f
commit 2b6986bd58
4 files changed
+4 -4

No files matched your search

+1 -1
View File
@@ -23,7 +23,7 @@ if (!cluster.isMaster) {
if (argv._[0] === 'db') {
function buildUrl(opts) {
let mongourl = `${opts.protocol}://`;
let mongourl = `${opts.protocol || 'mongodb'}://`;
if (opts.username) mongourl += `${opts.username}:${opts.password}@`;
mongourl += `${opts.host}:${opts.port}/${opts.name}`;
if (opts.url) mongourl = opts.url;