KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am running client that is connecting to a redis db. The client is on a WiFi connection and will drop the connection at times. Unfortunately, when this happens, the program just keeps running without throwing any type of warning. r = redis.StrictRedis(host=XX, password=YY...) ps = r.pubsub() ps.subscribe("12345") for items in ps.listen(): if items['type'] == 'message': data = items['data'] Ideally, what I am looking for is a catch an event when the connection is lost, try and reestablish the connection, do some error correcting, then get things back up and running. Should this be done in the python program? Should I have an external watchdog?
Tags (comma-separated)
Save Edits
Cancel