mirror of
https://github.com/zulip/zulip.git
synced 2025-11-16 20:02:15 +00:00
zephyr_mirror: Run both processes within a single application.
(imported from commit 8f379a682ede7076ddcbe046dee5be6592a5bbd9)
This commit is contained in:
@@ -61,7 +61,7 @@ class HumbugAPI():
|
||||
request["streams"] = simplejson.dumps(streams)
|
||||
return self.do_api_query(request, "/api/v1/subscribe")
|
||||
|
||||
def call_on_each_message(self, callback, idle_call = None, options = {}):
|
||||
def call_on_each_message(self, callback, options = {}):
|
||||
max_message_id = None
|
||||
while True:
|
||||
if max_message_id is not None:
|
||||
@@ -82,6 +82,3 @@ class HumbugAPI():
|
||||
for message in sorted(res['messages'], key=lambda x: int(x["id"])):
|
||||
max_message_id = max(max_message_id, int(message["id"]))
|
||||
callback(message)
|
||||
|
||||
if idle_call is not None:
|
||||
idle_call()
|
||||
|
||||
Reference in New Issue
Block a user