Skip to content

Commit

Permalink
Update PostgresClient.js (#7276)
Browse files Browse the repository at this point in the history
Proper pg-monitor re-attachment logic.
  • Loading branch information
vitaly-t authored Mar 18, 2021
1 parent 60eef47 commit 25fb476
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/Adapters/Storage/Postgres/PostgresClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@ export function createClient(uri, databaseOptions) {

if (process.env.PARSE_SERVER_LOG_LEVEL === 'debug') {
const monitor = require('pg-monitor');
try {
monitor.attach(initOptions);
} catch (e) {
if(monitor.isAttached()) {
monitor.detach();
monitor.attach(initOptions);
}
monitor.attach(initOptions);
}

if (dbOptions.pgOptions) {
Expand Down

0 comments on commit 25fb476

Please sign in to comment.