Execute Redis Flushall Command in Rails Application

I want to FLUSHALL redis every time the Rails server starts.

How can I do this?

Thanks in Advance.

P.S: I am new to rails, so excuse me if the question is very easy.

1 Answer

port = 10000
$redis = Redis.new(:port => port)
$redis.flushall

To run that on start up check

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

James H. Sterling

James H. Sterling

Environmental Science & Climate Journalist

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.

Share this article
Twitter Facebook Pinterest