From 8be905fea991edd26e29957b974df3eefe6ee4fa Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Tue, 11 Apr 2023 16:17:26 +0200 Subject: [PATCH] refs #5541 NPM upgraded, created date UTC fix --- Dockerfile | 2 +- config.yml | 2 +- mylogger.js | 11 ++++++++++- package.json | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 79d592d..323ef3d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ RUN apt-get update \ && curl -fsSL https://deb.nodesource.com/setup_14.x | bash - \ && apt-get install -y --no-install-recommends nodejs \ && rm -rf /var/lib/apt/lists/* \ - && npm i -g npm@9.5.0 + && npm i -g npm@9.6.4 # MyLogger diff --git a/config.yml b/config.yml index 21e3ca9..35b75e4 100644 --- a/config.yml +++ b/config.yml @@ -1,7 +1,7 @@ code: mylogger debug: false testMode: false -pingInterval: 3600 +pingInterval: 300 flushInterval: 30 restartTimeout: 30 queueFlushDelay: 200 diff --git a/mylogger.js b/mylogger.js index 9454caa..7b40760 100644 --- a/mylogger.js +++ b/mylogger.js @@ -613,12 +613,21 @@ module.exports = class MyLogger { break; } + let created = new Date(evt.timestamp); + created = Date.UTC( + created.getFullYear(), + created.getMonth(), + created.getDate(), + created.getHours(), + created.getMinutes(), + created.getSeconds() + ); + const modelName = tableInfo.modelName; const modelId = row[tableInfo.idName]; const modelValue = tableInfo.showField ? row[tableInfo.showField] || null : null; - const created = new Date(evt.timestamp); const oldInstance = oldI ? JSON.stringify(oldI) : null; const originFk = !tableInfo.isMain ? row[tableInfo.relation] diff --git a/package.json b/package.json index 8aab5f3..a898437 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mylogger", - "version": "0.1.2", + "version": "0.1.3", "author": "Verdnatura Levante SL", "description": "MySQL and MariaDB logger using binary log", "license": "GPL-3.0",