From bdc086c28579dc3f66545b2df36f0045c09cf70e Mon Sep 17 00:00:00 2001 From: yusing Date: Thu, 13 Feb 2025 03:06:18 +0800 Subject: [PATCH] increase icon cache ttl to 3 days, remove pruned message when no icon pruned --- internal/api/v1/favicon/cache.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/api/v1/favicon/cache.go b/internal/api/v1/favicon/cache.go index d138854..908a072 100644 --- a/internal/api/v1/favicon/cache.go +++ b/internal/api/v1/favicon/cache.go @@ -24,7 +24,7 @@ var ( ) const ( - iconCacheTTL = 24 * time.Hour + iconCacheTTL = 3 * 24 * time.Hour cleanUpInterval = time.Hour ) @@ -77,7 +77,9 @@ func pruneExpiredIconCache() { nPruned++ } } - logging.Info().Int("pruned", nPruned).Msg("pruned expired icon cache") + if nPruned > 0 { + logging.Info().Int("pruned", nPruned).Msg("pruned expired icon cache") + } } func routeKey(r route.HTTPRoute) string {