refs #5541 NPM upgraded, created date UTC fix
gitea/mylogger/pipeline/head This commit looks good Details

This commit is contained in:
Juan Ferrer 2023-04-11 16:17:26 +02:00
parent 16e15e739b
commit 8be905fea9
4 changed files with 13 additions and 4 deletions

View File

@ -13,7 +13,7 @@ RUN apt-get update \
&& curl -fsSL https://deb.nodesource.com/setup_14.x | bash - \ && curl -fsSL https://deb.nodesource.com/setup_14.x | bash - \
&& apt-get install -y --no-install-recommends nodejs \ && apt-get install -y --no-install-recommends nodejs \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
&& npm i -g npm@9.5.0 && npm i -g npm@9.6.4
# MyLogger # MyLogger

View File

@ -1,7 +1,7 @@
code: mylogger code: mylogger
debug: false debug: false
testMode: false testMode: false
pingInterval: 3600 pingInterval: 300
flushInterval: 30 flushInterval: 30
restartTimeout: 30 restartTimeout: 30
queueFlushDelay: 200 queueFlushDelay: 200

View File

@ -613,12 +613,21 @@ module.exports = class MyLogger {
break; 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 modelName = tableInfo.modelName;
const modelId = row[tableInfo.idName]; const modelId = row[tableInfo.idName];
const modelValue = tableInfo.showField const modelValue = tableInfo.showField
? row[tableInfo.showField] || null ? row[tableInfo.showField] || null
: null; : null;
const created = new Date(evt.timestamp);
const oldInstance = oldI ? JSON.stringify(oldI) : null; const oldInstance = oldI ? JSON.stringify(oldI) : null;
const originFk = !tableInfo.isMain const originFk = !tableInfo.isMain
? row[tableInfo.relation] ? row[tableInfo.relation]

View File

@ -1,6 +1,6 @@
{ {
"name": "mylogger", "name": "mylogger",
"version": "0.1.2", "version": "0.1.3",
"author": "Verdnatura Levante SL", "author": "Verdnatura Levante SL",
"description": "MySQL and MariaDB logger using binary log", "description": "MySQL and MariaDB logger using binary log",
"license": "GPL-3.0", "license": "GPL-3.0",