4295: Use EventMachine::schedule when there is potentially more events to send instea...
[arvados.git] / services / api / lib / eventbus.rb
index 9b15b2c5458370cd8c8eca87a20e4b816d3cfa9f..1754fc0ae9b2de1bd7cc70a8d5ed5f1172f481f8 100644 (file)
@@ -124,7 +124,9 @@ class EventBus
           # Number of rows returned was capped by limit(), we need to schedule
           # another query to get more logs (will start from last_log_id
           # reported by current query)
-          @channel.push nil
+          EventMachine::schedule do
+            push_events ws, nil
+          end
         elsif !notify_id.nil? and (ws.last_log_id.nil? or notify_id > ws.last_log_id)
           # Number of rows returned was less than cap, but the notify id is
           # higher than the last id visible to the client, so update last_log_id