constant Redis_Cache_Base::EVAL_DELETE_VOLATILE in Redis 7.2
Same name and namespace in other branches
- 7.3 lib/Redis/Cache/Base.php \Redis_Cache_Base::EVAL_DELETE_VOLATILE
Delete volatile by prefix lua script
File
- lib/
Redis/ Cache/ Base.php, line 91
Class
- Redis_Cache_Base
- Because those objects will be spawned during boostrap all its configuration must be set in the settings.php file.
Code
const EVAL_DELETE_VOLATILE = <<<EOT
local keys = redis.call('KEYS', ARGV[1])
for i, k in ipairs(keys) do
local key_type = redis.call("TYPE", k)
if "hash" == key_type and "1" == redis.call("HGET", k, "volatile") then
redis.call("DEL", k)
end
end
return 1
EOT
;