From ed96035a1474f8ec4cfbc1d3dd58b11ab9d2d914 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20M=C3=B6hlmann?= Date: Tue, 7 Jan 2025 13:51:06 +0200 Subject: [PATCH] fix(cache): convert expiry to number (#9143) # Which Problems Are Solved When `LastUseAge` was configured properly, the Redis LUA script uses manual cleanup for `MaxAge` based expiry. The expiry obtained from Redis apears to be a string and was compared to an int, resulting in a script error. # How the Problems Are Solved Convert expiry to number. # Additional Changes - none # Additional Context - Introduced in #8822 - LastUseAge was fixed in #9097 - closes https://github.com/zitadel/zitadel/issues/9140 (cherry picked from commit 56427cca50cc990bd168064d55559a0af9be4cdc) --- internal/cache/connector/redis/get.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/cache/connector/redis/get.lua b/internal/cache/connector/redis/get.lua index cfb3e89d8a..b542ff29d1 100644 --- a/internal/cache/connector/redis/get.lua +++ b/internal/cache/connector/redis/get.lua @@ -13,8 +13,8 @@ end -- max-age must be checked manually local expiry = getCall("HGET", object_id, "expiry") -if not (expiry == nil) and expiry > 0 then - if getTime() > expiry then +if not (expiry == nil) and tonumber(expiry) > 0 then + if getTime() > tonumber(expiry) then remove(object_id) return nil end