Skip to content

Instantly share code, notes, and snippets.

@mindware
Created March 26, 2015 05:46
Show Gist options
  • Save mindware/459b34f933d1914e2020 to your computer and use it in GitHub Desktop.
Save mindware/459b34f933d1914e2020 to your computer and use it in GitHub Desktop.
Atomically delete all resque keys from redis (requires you have enough memory to handle all keys)
EVAL "return redis.call('DEL', unpack(redis.call('KEYS', ARGV[1] .. '*')))" 0 resque:
@mindware
Copy link
Author

If you need to delete more keys than you have memory for in your server:
for _,k in ipairs(redis.call('keys', ARGV[1])) do
redis.call('del', k)
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment