server: Fix logging for health, aggregate them into 12 * 60 * 60 instances
continuous-integration/appveyor/branch AppVeyor build succeeded Details

master v2.2.5
Jonatan Nilsson 2022-08-15 20:22:21 +00:00
parent 5841dbdaab
commit f1be7e0d79
2 changed files with 3 additions and 3 deletions

View File

@ -43,7 +43,7 @@ export default class Server {
}) })
let healthChecks = 0 let healthChecks = 0
let healthCollectLimit = 10 let healthCollectLimit = 60 * 60 * 12
this.flaska.after(function(ctx) { this.flaska.after(function(ctx) {
let ended = performance.now() - ctx.__started let ended = performance.now() - ctx.__started
@ -60,7 +60,7 @@ export default class Server {
if (ctx.url === '/health') { if (ctx.url === '/health') {
healthChecks++ healthChecks++
if (healthChecks > healthCollectLimit) { if (healthChecks >= healthCollectLimit) {
ctx.log[level]({ ctx.log[level]({
duration: Math.round(ended), duration: Math.round(ended),
status: ctx.status, status: ctx.status,

View File

@ -1,6 +1,6 @@
{ {
"name": "storage-upload", "name": "storage-upload",
"version": "2.2.4", "version": "2.2.5",
"description": "Micro service for uploading and image resizing files to a storage server.", "description": "Micro service for uploading and image resizing files to a storage server.",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {