From 659b0ba889d90656c7a40b6dc4eeac878b6504eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Mon, 5 Nov 2018 18:14:26 +0100 Subject: [PATCH] Use pdql.end with callback --- package-lock.json | 6 +++--- test/support/test-client.js | 5 +---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2ff0c876..833de929 100644 --- a/package-lock.json +++ b/package-lock.json @@ -406,7 +406,7 @@ } }, "cartodb-psql": { - "version": "github:cartodb/node-cartodb-psql#cd7328ce0ef77c3c17227b706f7862ff5b2951a3", + "version": "github:cartodb/node-cartodb-psql#56744d4463a87f3a7f9209413a3f0efd127a4fea", "from": "github:cartodb/node-cartodb-psql#nodejs-10", "requires": { "debug": "^3.1.0", @@ -3871,7 +3871,7 @@ "integrity": "sha1-tDFbtCFKPXBY6+7okuE/ok2YsHU=" }, "windshaft": { - "version": "github:cartodb/windshaft#eeab518fd51871f6730d51c0b907e82d7eff3705", + "version": "github:cartodb/windshaft#042d1f3986a70d8d9f530a37643efa92535a7163", "from": "github:cartodb/windshaft#nodejs-10", "requires": { "@carto/mapnik": "3.6.2-carto.11", @@ -3879,7 +3879,7 @@ "abaculus": "github:cartodb/abaculus#4dc05ba2e91697ed5fc68734ffa3ffb46290c942", "canvas": "github:cartodb/node-canvas#232053066f3b0e711113d4a5af042a1a448199cd", "carto": "github:cartodb/carto#161516b7211d4be6bf401ab1957cb5cebc139f81", - "cartodb-psql": "github:cartodb/node-cartodb-psql#cd7328ce0ef77c3c17227b706f7862ff5b2951a3", + "cartodb-psql": "github:cartodb/node-cartodb-psql#56744d4463a87f3a7f9209413a3f0efd127a4fea", "debug": "3.1.0", "dot": "1.1.2", "grainstore": "github:cartodb/grainstore#e9828cc7f2777b7af61b7328269f32fdb5fb6b42", diff --git a/test/support/test-client.js b/test/support/test-client.js index 8f9a8376..8801b4a1 100644 --- a/test/support/test-client.js +++ b/test/support/test-client.js @@ -1262,8 +1262,6 @@ TestClient.prototype.getDBConnection = function () { return psql; }; -const pg = require('pg'); - TestClient.prototype.setUserDatabaseTimeoutLimit = function (timeoutLimit, callback) { const dbname = _.template(global.environment.postgres_auth_user, { user_id: 1 }) + '_db'; const dbuser = _.template(global.environment.postgres_auth_user, { user_id: 1 }); @@ -1290,8 +1288,7 @@ TestClient.prototype.setUserDatabaseTimeoutLimit = function (timeoutLimit, callb }, // we need to guarantee all new connections have the new settings function refreshPoolConnection () { - pg.once('end', () => callback()); - pg.end(); + psql.end(() => callback()); } ); };