From: Peter Amstutz Date: Tue, 14 Jun 2016 17:28:32 +0000 (-0400) Subject: 9388: Only record log ids sent during "catch up" phase, to avoid duplicates. X-Git-Tag: 1.1.0~890^2~2 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/3f3b57c67af8967d466cf69b4c8e41885eee13c8 9388: Only record log ids sent during "catch up" phase, to avoid duplicates. --- diff --git a/services/api/lib/eventbus.rb b/services/api/lib/eventbus.rb index 58188efa36..cce6798cb0 100644 --- a/services/api/lib/eventbus.rb +++ b/services/api/lib/eventbus.rb @@ -116,9 +116,14 @@ class EventBus lastid = nil logs.limit(limit).each do |l| - if ws.sent_ids.add?(l.id) != nil + if not ws.sent_ids.include?(l.id) + # only send if not a duplicate ws.send(l.as_api_response.to_json) end + if not ws.last_log_id.nil? + # only record ids from "catchup" messages and not notifies + ws.sent_ids << l.id + end lastid = l.id count += 1 end @@ -135,9 +140,6 @@ class EventBus # Done catching up ws.last_log_id = nil end - elsif !notify_id.nil? - # No filters set up, so just record the sequence number - ws.last_log_id = notify_id end rescue ArgumentError => e # There was some kind of user error.