Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Mar 8, 2019
1 parent c4bc545 commit 0b35449
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/appier/bus.py
Expand Up @@ -191,6 +191,7 @@ def _close(self):
def _loop(self, safe = True):
for item in self._pubsub.listen():
try:
if not self.loaded: break
self._tick(item, safe = safe)
except Exception as exception:
self.logger.critical("Unhandled redis loop exception raised")
Expand All @@ -199,12 +200,11 @@ def _loop(self, safe = True):
for line in lines: self.logger.warning(line)

def _tick(self, item, safe = True):
if not self.loaded: break
channel = item.get("channel", None)
channel = legacy.str(channel)
type = item.get("type", None)
data = item.get("data", None)
if not type in ("message",): continue
if not type in ("message",): return
if ":" in channel: _prefix, name = channel.split(":", 1)
else: name = channel
data = self._serializer.loads(data)
Expand Down

0 comments on commit 0b35449

Please sign in to comment.