Rpj
Rpj

Reputation: 6080

How to remove redis specific application cache via capistrano prior to a restart

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.

Upvotes: 0

Views: 491

Answers (1)

Max Ivanov
Max Ivanov

Reputation: 6561

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

Upvotes: 1

Related Questions