From 584ba31d60cccd0b559da46d07f11eadde8a5b92 Mon Sep 17 00:00:00 2001 From: Gavin Sharp Date: Fri, 9 Nov 2018 10:12:11 -0500 Subject: [PATCH 1/2] don't call Promise.config Avoids calling bluebird's `Promise.config`, since other code may have already created some promises. --- lib/connection.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/lib/connection.js b/lib/connection.js index be12658..c28e80f 100644 --- a/lib/connection.js +++ b/lib/connection.js @@ -28,13 +28,6 @@ var Redshift = function (config, options) { }); } - // unless there's an option disabling long stack traces, enable long stack traces - if(!options || (options && (options.longStackTraces == undefined || options.longStackTraces === true))){ - Promise.config({ - longStackTraces: true - }); - } - // add additional pg modules to redshift object that.types = pg.types; } else { @@ -68,4 +61,4 @@ Redshift.prototype.connect = function (callback) { } }; -module.exports = Redshift; \ No newline at end of file +module.exports = Redshift; From 581a3d384135f8cb73f3521588d8e35f4675ee93 Mon Sep 17 00:00:00 2001 From: Gavin Sharp Date: Fri, 9 Nov 2018 10:18:19 -0500 Subject: [PATCH 2/2] update README --- README.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 0127690..9320e1d 100644 --- a/README.md +++ b/README.md @@ -74,13 +74,11 @@ var redshiftClient = new Redshift(client, {rawConnection: true}); Connection pooling works by default with no extra configuration. [Here's an example of connection pooling](https://github.com/dmanjunath/node-redshift/blob/master/examples/connection_pooling.js) ##### Setup Options -There are two options that can be passed into the options object in the Redshift constructor. - -| Option | Type | Description | -| --------------------- |:-------------:| ---------------------------------------------------------------------------------:| -| rawConnection | Boolean | If you want a raw connection, pass true with this option | -| longStackTraces | Boolean | Default: true. If you want to disable [bluebird's longStackTraces](http://bluebirdjs.com/docs/api/promise.longstacktraces.html), pass in false | +The Redshift constructor accepts an option object with the following properties: +| Option | Type | Description | +| --------------------- |:-------------:| ---------------------------------------------------------------------------- | +| rawConnection | Boolean | Default: false. Pass true to use a raw connection. | ## Usage