Update PostgresClient.js (#7276)
Proper pg-monitor re-attachment logic.
This commit is contained in:
@@ -20,12 +20,10 @@ export function createClient(uri, databaseOptions) {
|
|||||||
|
|
||||||
if (process.env.PARSE_SERVER_LOG_LEVEL === 'debug') {
|
if (process.env.PARSE_SERVER_LOG_LEVEL === 'debug') {
|
||||||
const monitor = require('pg-monitor');
|
const monitor = require('pg-monitor');
|
||||||
try {
|
if(monitor.isAttached()) {
|
||||||
monitor.attach(initOptions);
|
|
||||||
} catch (e) {
|
|
||||||
monitor.detach();
|
monitor.detach();
|
||||||
monitor.attach(initOptions);
|
|
||||||
}
|
}
|
||||||
|
monitor.attach(initOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dbOptions.pgOptions) {
|
if (dbOptions.pgOptions) {
|
||||||
|
|||||||
Reference in New Issue
Block a user