Adjust lease duration to prevent cache update conflicts

Updated lease duration logic to ensure a minimum of 1 second.
This commit is contained in:
maxlerebourg
2026-08-07 12:12:59 +02:00
committed by GitHub
parent 0ed8154340
commit 022747488c
+1 -2
View File
@@ -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