Merge pull request #429 from CartoDB/do-not-use-pg-end

Use method 'psql.end' exposed by 'cartodb-psql'
This commit is contained in:
Raul Ochoa 2017-08-11 19:17:25 +02:00 committed by GitHub
commit bfd403812a

View File

@ -7,8 +7,6 @@ var redisUtils = require('./redis_utils');
const step = require('step');
const PSQL = require('cartodb-psql');
const _ = require('underscore');
// TODO: remove after upgrading cartodb-psql to 0.9.0
const pg = require('pg');
function response(code) {
return {
@ -115,10 +113,6 @@ TestClient.prototype.setUserDatabaseTimeoutLimit = function (user, timeoutLimit,
const pass = _.template(global.settings.db_user_pass, { user_id: 1 })
const publicuser = global.settings.db_pubuser;
// TODO: We do need to upgrade cartodb-psql to 0.9.0 to use psql.end() instead.
// we need to guarantee all new connections have the new settings
pg.end();
const psql = new PSQL({
user: 'postgres',
dbname: dbname,
@ -126,6 +120,9 @@ TestClient.prototype.setUserDatabaseTimeoutLimit = function (user, timeoutLimit,
port: global.settings.db_port
});
// we need to guarantee all new connections have the new settings
psql.end();
step(
function configureTimeouts () {
const timeoutSQLs = [