Skip to content

Commit ef7309d

Browse files
committed
Merge pull request #1 from vitaly-t/patch-1
Update CRUDService.js
2 parents 066e96e + 9fb8180 commit ef7309d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Backend/src/modules/crud/services/CRUDService.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
const _ = require('lodash');
1010
const Joi = require('joi');
1111
const config = require('config');
12-
const pgp = require('pg-promise')();
1312
const ValidationError = require('../../../common/errors').ValidationError;
1413
const NotFoundError = require('../../../common/errors').NotFoundError;
1514
const logger = require('../../../common/logger');
1615

16+
const pgp = require('pg-promise')();
17+
const db = pgp(config.dbConfig.db_url);
1718

1819
// set the pool size
1920
pgp.pg.defaults.poolSize = config.dbConfig.poolSize;
@@ -214,7 +215,6 @@ function _searchQuery(tableName, criteria, columns) {
214215
* @private
215216
*/
216217
function* _runSql(methodName, params) {
217-
const db = pgp(config.dbConfig.db_url);
218218
return yield db[methodName](params.sql, params.parameters);
219219
}
220220

0 commit comments

Comments
 (0)