From b25e00c79ea67013164a520ff3c99e1b62efa5bd Mon Sep 17 00:00:00 2001 From: mchavez Date: Thu, 29 Aug 2024 13:22:18 -0600 Subject: [PATCH] Adding statistics --- pkg/uhttp/dbcache.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/uhttp/dbcache.go b/pkg/uhttp/dbcache.go index 9265fcd0d..5174080e5 100644 --- a/pkg/uhttp/dbcache.go +++ b/pkg/uhttp/dbcache.go @@ -99,7 +99,7 @@ func NewDBCache(ctx context.Context, cfg CacheConfig) (*DBCache, error) { go func() { ctxWithTimeout, cancel := context.WithTimeout( ctx, - time.Duration(180)*time.Minute, + time.Duration(1)*time.Minute, ) defer cancel() @@ -109,6 +109,7 @@ func NewDBCache(ctx context.Context, cfg CacheConfig) (*DBCache, error) { select { case <-ctxWithTimeout.Done(): // ctx done, shutting down cache cleanup routine + ticker.Stop() err := dc.cleanup(ctx) if err != nil { l.Debug("shutting down cache failed", zap.Error(err))