From 022747488c2f02c706c980dd73444612d0df0847 Mon Sep 17 00:00:00 2001 From: maxlerebourg Date: Fri, 7 Aug 2026 12:12:59 +0200 Subject: [PATCH] Adjust lease duration to prevent cache update conflicts Updated lease duration logic to ensure a minimum of 1 second. --- bouncer.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bouncer.go b/bouncer.go index 6275248..5f02e27 100644 --- a/bouncer.go +++ b/bouncer.go @@ -641,8 +641,7 @@ func handleStreamCache(bouncer *Bouncer) error { if err.Error() != cache.CacheMiss { return err } - // The lease expires just before the next tick, but it also has to be stored at all: - // the local cache ignores a zero duration and redis rejects a non positive EX. + // To avoid every instance trying to update the cache, set 1 second at least leaseDuration := bouncer.updateInterval - 1 if leaseDuration < 1 { leaseDuration = 1