server: Fix logging for health, aggregate them into 12 * 60 * 60 instances
All checks were successful
continuous-integration/appveyor/branch AppVeyor build succeeded
All checks were successful
continuous-integration/appveyor/branch AppVeyor build succeeded
This commit is contained in:
parent
5841dbdaab
commit
f1be7e0d79
2 changed files with 3 additions and 3 deletions
|
@ -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,
|
||||||
|
|
|
@ -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": {
|
||||||
|
|
Loading…
Reference in a new issue