Fix resetting access token on streams with keepalive (#22148)

This commit is contained in:
Jason Hunter authored and Charles Garwood committed 2019-03-18 09:27:34 -04:00
1 parent e14b243336
commit ce5cf5803c
2 files changed
+19 -3

No files matched your search

@@ -120,10 +120,16 @@ class Stream:
"""Remove provider output stream."""
if provider.format in self._outputs:
del self._outputs[provider.format]
self.check_idle()
if not self._outputs:
self.stop()
def check_idle(self):
"""Reset access token if all providers are idle."""
if all([p.idle for p in self._outputs.values()]):
self.access_token = None
def start(self):
"""Start a stream."""
if self._thread is None or not self._thread.isAlive():