Commit ac30a1b6 authored by Guillaume Binet's avatar Guillaume Binet Committed by GitHub

Merge pull request #871 from cniemira/master

Increase the efficiency of the Slack backend for busy instances
parents f2af0d79 d2c5b0a7
......@@ -319,9 +319,12 @@ class SlackBackend(ErrBot):
try:
while True:
for message in self.sc.rtm_read():
self._dispatch_slack_message(message)
time.sleep(1)
messages = self.sc.rtm_read()
if messages:
for message in messages:
self._dispatch_slack_message(message)
else:
time.sleep(1)
except KeyboardInterrupt:
log.info("Interrupt received, shutting down..")
return True
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment