Question

How to remove redis specific application cache via capistrano prior to a restart. Redis is running a remote machine and the redis client need not be installed on the machine which performs the deployment.

Was it helpful?

Solution

As long as capistrano can run any command upon deployment, just remove the cache key(s) with redis-cli:

role :redisserver, "127.0.0.1"
...

namespace :deploy do
...

before "deploy:restart", "deploy:reset_redis_cache"
task :reset_redis_cache, :roles => :rediserver do
  run "redis-cli DEL cachekey"
end

...

UPD. added role reference

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top