refs #5368 Added new code errors to retry conn
gitea/printnatura/pipeline/head This commit looks good Details

This commit is contained in:
Guillermo Bonet 2024-09-09 08:38:13 +02:00
parent ba7c29a36a
commit 3d3b4397a5
1 changed files with 1 additions and 1 deletions

View File

@ -101,7 +101,7 @@ class PrintServer {
this.errorHandler(err); this.errorHandler(err);
} }
errorHandler(err) { errorHandler(err) {
if (err.code === 'ETIMEDOUT') { if (['ETIMEDOUT', 'ECONNRESET', 'PROTOCOL_CONNECTION_LOST'].includes(err.code)) {
if (!this.dbDown) { if (!this.dbDown) {
this.dbDown = true; this.dbDown = true;
this.serverLog('error', `DB connection lost: ${err.message}`); this.serverLog('error', `DB connection lost: ${err.message}`);