1
0
Fork 0
mirror of https://github.com/chrislusf/seaweedfs synced 2024-07-02 23:26:42 +02:00
seaweedfs/weed/filer/redis_lua/stored_procedure/delete_folder_children.lua
2022-02-15 20:54:57 +08:00

15 lines
372 B
Lua

-- KEYS[1]: full path of entry
local fullpath = KEYS[1]
if fullpath ~= "" and string.sub(fullpath, -1) == "/" then
fullpath = string.sub(fullpath, 0, -2)
end
local files = redis.call("ZRANGE", fullpath .. "\0", "0", "-1")
for _, name in ipairs(files) do
local file_path = fullpath .. "/" .. name
redis.call("DEL", file_path, file_path .. "\0")
end
return 0