You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and then inline the modified script into cleanup.lua
for key,value in pairs(resourcesToClean) do
redis.log(redis.LOG_NOTICE, "cleanup resource: "..value)
KEYS[1] = string.sub(value, resourcePrefixLength+1, string.len(value))
--%(delscript) <-- del.lua with commented return statements
counter = counter + 1
end
There are several disadvantages with this approach:
a) We can't use functions such as
local function isResource(key)
return redis.call('exists',resourcesPrefix..key) <-- will be commented
end
in del.lua
b) We can't do a "return early from method"
c) We also increment the counter when nothing has been deleted
Hence the idea to get rid of the cleanup.lua and implement this in Java (but still call the del.lua).
The text was updated successfully, but these errors were encountered:
We currently comment all return statements from del.lua using
values.put("delscript", readLuaScriptFromClasspath(LuaScript.DELETE).replaceAll("return", "--return"));
and then inline the modified script into cleanup.lua
for key,value in pairs(resourcesToClean) do
redis.log(redis.LOG_NOTICE, "cleanup resource: "..value)
KEYS[1] = string.sub(value, resourcePrefixLength+1, string.len(value))
--%(delscript) <-- del.lua with commented return statements
counter = counter + 1
end
There are several disadvantages with this approach:
a) We can't use functions such as
local function isResource(key)
return redis.call('exists',resourcesPrefix..key) <-- will be commented
end
in del.lua
b) We can't do a "return early from method"
c) We also increment the counter when nothing has been deleted
Hence the idea to get rid of the cleanup.lua and implement this in Java (but still call the del.lua).
The text was updated successfully, but these errors were encountered: