From 923ab9d5d5c69b248f30aa34d5b7c14b036a04c2 Mon Sep 17 00:00:00 2001 From: corverroos Date: Mon, 24 Jul 2023 22:30:22 +0200 Subject: [PATCH 1/2] app/log: decrease default log fitler from 1h to 1m --- app/log/filter.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/log/filter.go b/app/log/filter.go index a10698a24..83450f3c1 100644 --- a/app/log/filter.go +++ b/app/log/filter.go @@ -26,9 +26,9 @@ type filter struct { limit rate.Limit } -// defaultFilter returns the default filter with a period of 1 hour. +// defaultFilter returns the default filter with a period of 1 minute. func defaultFilter() filter { - return filter{limit: rate.Every(time.Hour)} + return filter{limit: rate.Every(time.Minute)} } // Filter returns a stateful structure logging field that results in @@ -39,7 +39,7 @@ func defaultFilter() filter { // for event := range eventPipe() { // err := process(event) // if err != nil { -// log.Error(ctx, "This error should only be logged max once an hour", err, filter) +// log.Error(ctx, "This error should only be logged max once an minute", err, filter) // } // } func Filter(opts ...FilterOption) z.Field { From 03114590487f927ed36ce10cfb067c13c988ddc7 Mon Sep 17 00:00:00 2001 From: corverroos Date: Mon, 24 Jul 2023 22:33:45 +0200 Subject: [PATCH 2/2] cleanup --- app/log/filter.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/log/filter.go b/app/log/filter.go index 83450f3c1..b448dcad7 100644 --- a/app/log/filter.go +++ b/app/log/filter.go @@ -26,9 +26,9 @@ type filter struct { limit rate.Limit } -// defaultFilter returns the default filter with a period of 1 minute. +// defaultFilter returns the default filter with a period of 1 slot. func defaultFilter() filter { - return filter{limit: rate.Every(time.Minute)} + return filter{limit: rate.Every(time.Second * 12)} } // Filter returns a stateful structure logging field that results in @@ -39,7 +39,7 @@ func defaultFilter() filter { // for event := range eventPipe() { // err := process(event) // if err != nil { -// log.Error(ctx, "This error should only be logged max once an minute", err, filter) +// log.Error(ctx, "This error should only be logged max once a slot (12s)", err, filter) // } // } func Filter(opts ...FilterOption) z.Field {