From 740559f2f860f63557ff3cff3c43b3907f89ff03 Mon Sep 17 00:00:00 2001 From: Noah Zalev Date: Thu, 29 Apr 2021 23:55:37 -0400 Subject: [PATCH] Improved connectionObject creation --- db.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/db.js b/db.js index dce081a5..90704fe0 100644 --- a/db.js +++ b/db.js @@ -443,15 +443,8 @@ module.exports.CreateDB = function (parent, func) { var dbname = (connectinArgs.database != null) ? connectinArgs.database : 'meshcentral'; // Including the db name in the connection obj will cause a connection failure if it does not exist - var connectionObject = { - 'host': connectinArgs.host, - 'port': connectinArgs.port, - 'user': connectinArgs.user, - 'password': connectinArgs.password, - 'connectionLimit': null - }; - if (connectinArgs.connectionLimit != null) connectionObject.connectionLimit = connectinArgs.connectionLimit; - + var connectionObject = Clone(connectinArgs); + delete connectionObject.database; if (parent.args.mariadb) { // Use MariaDB