From f1be7e0d798456e4a32de98bccb8b6d3b92bdee8 Mon Sep 17 00:00:00 2001 From: Jonatan Nilsson Date: Mon, 15 Aug 2022 20:22:21 +0000 Subject: [PATCH] server: Fix logging for health, aggregate them into 12 * 60 * 60 instances --- api/server.mjs | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/server.mjs b/api/server.mjs index 1c5e261..bf9f77c 100644 --- a/api/server.mjs +++ b/api/server.mjs @@ -43,7 +43,7 @@ export default class Server { }) let healthChecks = 0 - let healthCollectLimit = 10 + let healthCollectLimit = 60 * 60 * 12 this.flaska.after(function(ctx) { let ended = performance.now() - ctx.__started @@ -60,7 +60,7 @@ export default class Server { if (ctx.url === '/health') { healthChecks++ - if (healthChecks > healthCollectLimit) { + if (healthChecks >= healthCollectLimit) { ctx.log[level]({ duration: Math.round(ended), status: ctx.status, diff --git a/package.json b/package.json index 954a8c6..c71f746 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "storage-upload", - "version": "2.2.4", + "version": "2.2.5", "description": "Micro service for uploading and image resizing files to a storage server.", "main": "index.js", "scripts": {