@ejfdelgado/ejflab-back 1.30.11 → 1.30.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/srv/PostgresSrv.mjs +10 -0
package/package.json
CHANGED
package/srv/PostgresSrv.mjs
CHANGED
@@ -147,6 +147,16 @@ export class PostgresSrv {
|
|
147
147
|
database: params.database,
|
148
148
|
connectionTimeoutMillis: parseInt(params.timeout),
|
149
149
|
});
|
150
|
+
PostgresSrv.pool.on('error', (err) => {
|
151
|
+
// try reconnect given the tipe of error
|
152
|
+
console.log("-------------------------------------");
|
153
|
+
console.log("------------------ Handling error ---");
|
154
|
+
console.log("-------------------------------------");
|
155
|
+
console.log(JSON.stringify(err.message));
|
156
|
+
if (err.message == "read ETIMEDOUT") {
|
157
|
+
PostgresSrv.createPool();
|
158
|
+
}
|
159
|
+
});
|
150
160
|
}
|
151
161
|
|
152
162
|
static async checkSelect1() {
|