From fbe712ffbbdea612a9edd765ca20508fa11de76b Mon Sep 17 00:00:00 2001 From: "Vojtech Vitek (golang.cz)" Date: Wed, 23 Oct 2024 16:36:53 +0200 Subject: [PATCH] Relax the fallback timeout by default Increase the default fallback timeout, to give Redis over network more time before falling back to local in-memory-counter. Users can override this value. --- httprateredis.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/httprateredis.go b/httprateredis.go index d4f9bd2..cfd64a4 100644 --- a/httprateredis.go +++ b/httprateredis.go @@ -50,7 +50,7 @@ func NewCounter(cfg *Config) *redisCounter { } else { // Activate local in-memory fallback fairly quickly, // so we don't slow down incoming requests too much. - cfg.FallbackTimeout = 100 * time.Millisecond + cfg.FallbackTimeout = 250 * time.Millisecond } }