Browse files

Trigger SUBSCRIBE callback if connection to redis server was lost

  • Loading branch information...
1 parent c71d5cf commit eb80da991d6c2697fc9c9bb51416561cca1bbea8 @mrjoes committed Dec 26, 2012
Showing with 13 additions and 0 deletions.
  1. +6 −0 debian/changelog
  2. +7 −0 toredis/client.py
View
6 debian/changelog
@@ -1,3 +1,9 @@
+python-toredis (0.0.5) unstable; urgency=low
+
+ * New build.
+
+ -- Serge S. Koval <serge.koval+github@gmail.com> Wed, 26 Dec 2012 14:10:57 +0200
+
python-toredis (0.0.4) unstable; urgency=low
* New build.
View
7 toredis/client.py
@@ -202,6 +202,13 @@ def _on_close(self, data=None):
except:
logger.exception('Exception in callback')
+ if self._sub_callback:
+ try:
+ self._sub_callback(None)
+ except:
+ logger.exception('Exception in SUB callback')
+ self._sub_callback = None
+
# Trigger on_disconnect
self.on_disconnect()

0 comments on commit eb80da9

Please sign in to comment.