Files
zitadel/internal/cache/connector/redis/_remove.lua
Tim Möhlmann 64bddb328c perf(cache): use redis unlink for key deletion (#10658)
# Which Problems Are Solved

The usage of the Redis `DEL` command showed blocking and slowdowns
during load-tests.

# How the Problems Are Solved

Use [`UNLINK`](https://redis.io/docs/latest/commands/UNLINK/) instead.

# Additional Changes

- none

# Additional Context

- closes https://github.com/zitadel/zitadel/issues/8930

(cherry picked from commit a06ae2c835)
2025-09-08 14:55:36 +02:00

11 lines
280 B
Lua

local function remove(object_id)
local setKey = keySetKey(object_id)
local keys = redis.call("SMEMBERS", setKey)
local n = #keys
for i = 1, n do
redis.call("UNLINK", keys[i])
end
redis.call("UNLINK", setKey)
redis.call("UNLINK", object_id)
end