From: Timo Ewalds Date: Mon, 19 Aug 2013 22:50:37 +0000 (-0400) Subject: Default is just to do nothing and let it reconnect X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=c701b6c4018cf4d8707f0a48ebcee0c6f5dbe0c3;p=tweepy.git Default is just to do nothing and let it reconnect --- diff --git a/tweepy/streaming.py b/tweepy/streaming.py index a8aa0b1..b0c9523 100644 --- a/tweepy/streaming.py +++ b/tweepy/streaming.py @@ -2,7 +2,6 @@ # Copyright 2009-2010 Joshua Roesslein # See LICENSE for details. -import logging import httplib from socket import timeout from threading import Thread @@ -80,22 +79,10 @@ class StreamListener(object): def on_disconnect(self, notice): """Called when twitter sends a disconnect notice - All disconnect codes are listed here: + Disconnect codes are listed here: https://dev.twitter.com/docs/streaming-apis/messages#Disconnect_messages_disconnect """ - if notice['code'] in ( - 2, # duplicate stream - 3, # control request, shut down by control stream - 5, # shut down by this client - 6, # token revoked, auth will fail next time - 7, # admin logout, connected elsewhere - 9, # max message limit - ): - logging.info("Disconnect notice code %s received, disconnecting", notice['code']) - return False - else: # reconnect - logging.info("Disconnect notice code %s received, reconnecting", notice['code']) - return + return class Stream(object):