Skip to content

Commit c876337

Browse files
committed
[db] fix connections for external jobs
1 parent 7353010 commit c876337

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

plugins/pluginManager.js

+4-12
Original file line numberDiff line numberDiff line change
@@ -1088,23 +1088,15 @@ var pluginManager = function pluginManager() {
10881088
* @returns {object} db connection params
10891089
**/
10901090
this.dbConnection = function(config) {
1091-
if (process.argv[1].endsWith('executor.js')) {
1092-
if (!config || !config.mongodb) {
1093-
console.log('************************************ executor.js common.db *********************************** no config', process.argv);
1094-
return this.singleDefaultConnection();
1095-
}
1096-
else if ((typeof config.mongodb === 'string' && config.mongodb.indexOf('maxPoolSize=3') === -1) ||
1097-
(typeof config.mongodb === 'object' && config.mongodb.max_pool_size !== 3)) {
1098-
console.log('************************************ executor.js common.db *********************************** wrong pool size', process.argv);
1099-
return this.singleDefaultConnection();
1100-
}
1101-
}
1102-
11031091
var db, maxPoolSize = 10;
1092+
11041093
if (!cluster.isMaster) {
11051094
//we are in worker
11061095
maxPoolSize = 100;
11071096
}
1097+
if (process.argv[1].endsWith('executor.js')) {
1098+
maxPoolSize = 3;
1099+
}
11081100
if (typeof config === "string") {
11091101
db = config;
11101102
if (this.dbConfigFiles[config]) {

0 commit comments

Comments
 (0)