Kevin Bedell
Kevin Bedell

Reputation: 13404

How to tell redis has gone away using redis-rb gem

I'm using the gem redis-rb to build some Ruby on Rails apps that are using redis.

I'd like to build in some logic to periodically check to see the redis instance I'm connected to has gone away.

What's the lowest overhead, fastest way of doing so?

Upvotes: 1

Views: 171

Answers (1)

TheDude
TheDude

Reputation: 3952

Do a ping to the server by doing redis.ping.

Upvotes: 3

Related Questions