[ARVADOS] updated: 3f3b57c67af8967d466cf69b4c8e41885eee13c8

Git user git at public.curoverse.com
Tue Jun 14 13:32:15 EDT 2016


Summary of changes:
 services/api/lib/eventbus.rb | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

       via  3f3b57c67af8967d466cf69b4c8e41885eee13c8 (commit)
      from  65721c02e81f29cb8e40aab4b3d35bebc4f23cc6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 3f3b57c67af8967d466cf69b4c8e41885eee13c8
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Tue Jun 14 13:28:32 2016 -0400

    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 58188ef..cce6798 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.

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list