delete_entry.lua 464 B

12345678910111213141516171819
  1. -- KEYS[1]: full path of entry
  2. local fullpath = KEYS[1]
  3. -- KEYS[2]: full path of entry
  4. local fullpath_list_key = KEYS[2]
  5. -- KEYS[3]: dir of the entry
  6. local dir_list_key = KEYS[3]
  7. -- ARGV[1]: isSuperLargeDirectory
  8. local isSuperLargeDirectory = ARGV[1] == "1"
  9. -- ARGV[2]: name of the entry
  10. local name = ARGV[2]
  11. redis.call("DEL", fullpath, fullpath_list_key)
  12. if not isSuperLargeDirectory and name ~= "" then
  13. redis.call("ZREM", dir_list_key, name)
  14. end
  15. return 0