mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-29 22:23:12 -06:00
Make sure to disconnect the streams as tweepy implements it
This commit is contained in:
parent
9053fcd5de
commit
77eadb42bb
@ -655,17 +655,20 @@ class Controller(object):
|
|||||||
log.debug("Saving global configuration...")
|
log.debug("Saving global configuration...")
|
||||||
for item in sessions.sessions:
|
for item in sessions.sessions:
|
||||||
if sessions.sessions[item].logged == False: continue
|
if sessions.sessions[item].logged == False: continue
|
||||||
|
log.debug("Disconnecting streaming endpoint for session" + sessions.sessions[item].session_id)
|
||||||
|
sessions.sessions[item].stop_streaming()
|
||||||
log.debug("Disconnecting streams for %s session" % (sessions.sessions[item].session_id,))
|
log.debug("Disconnecting streams for %s session" % (sessions.sessions[item].session_id,))
|
||||||
sessions.sessions[item].sound.cleaner.cancel()
|
sessions.sessions[item].sound.cleaner.cancel()
|
||||||
log.debug("Saving database for " + sessions.sessions[item].session_id)
|
log.debug("Saving database for " + sessions.sessions[item].session_id)
|
||||||
sessions.sessions[item].save_persistent_data()
|
sessions.sessions[item].save_persistent_data()
|
||||||
log.debug("Disconnecting streaming endpoint for session" + sessions.sessions[item].session_id)
|
|
||||||
sessions.sessions[item].stop_streaming()
|
|
||||||
if system == "Windows":
|
if system == "Windows":
|
||||||
self.systrayIcon.RemoveIcon()
|
self.systrayIcon.RemoveIcon()
|
||||||
pidpath = os.path.join(os.getenv("temp"), "{}.pid".format(application.name))
|
pidpath = os.path.join(os.getenv("temp"), "{}.pid".format(application.name))
|
||||||
if os.path.exists(pidpath):
|
if os.path.exists(pidpath):
|
||||||
os.remove(pidpath)
|
os.remove(pidpath)
|
||||||
|
if hasattr(self, "streams_checker_function"):
|
||||||
|
log.debug("Stopping stream checker...")
|
||||||
|
self.streams_checker_function.cancel()
|
||||||
widgetUtils.exit_application()
|
widgetUtils.exit_application()
|
||||||
|
|
||||||
def follow(self, *args, **kwargs):
|
def follow(self, *args, **kwargs):
|
||||||
|
@ -510,9 +510,8 @@ class Session(base.baseSession):
|
|||||||
self.stream_thread = call_threaded(self.stream.filter, follow=self.stream_listener.users, stall_warnings=True)
|
self.stream_thread = call_threaded(self.stream.filter, follow=self.stream_listener.users, stall_warnings=True)
|
||||||
|
|
||||||
def stop_streaming(self):
|
def stop_streaming(self):
|
||||||
if hasattr(self, "stream_thread"):
|
self.stream.running = False
|
||||||
self.stream_thread.join()
|
log.debug("Stream stopped for accounr {}".format(self.db["user_name"]))
|
||||||
log.debug("Stopping Streaming Endpoint...")
|
|
||||||
|
|
||||||
def handle_new_status(self, status, user):
|
def handle_new_status(self, status, user):
|
||||||
""" Handles a new status present in the Streaming API. """
|
""" Handles a new status present in the Streaming API. """
|
||||||
|
Loading…
Reference in New Issue
Block a user