lib/sup/poll.rb in sup-0.12 vs lib/sup/poll.rb in sup-0.12.1

- old
+ new

@@ -113,14 +113,15 @@ poll_from source do |action,m,old_m,progress| if action == :delete yield "Deleting #{m.id}" elsif action == :add if old_m - if not old_m.locations.member? m.location - yield "Message at #{m.source_info} is an updated of an old message. Updating labels from #{old_m.labels.to_a * ','} => #{m.labels.to_a * ','}" + new_locations = (m.locations - old_m.locations) + if not new_locations.empty? + yield "Message at #{new_locations[0].info} is an update of an old message. Updating labels from #{old_m.labels.to_a * ','} => #{m.labels.to_a * ','}" else - yield "Skipping already-imported message at #{m.source_info}" + yield "Skipping already-imported message at #{m.locations[-1].info}" end else yield "Found new message at #{m.source_info} with labels #{m.labels.to_a * ','}" loaded_labels.merge m.labels num += 1 @@ -180,9 +181,11 @@ Index.sync_message m, false #UpdateManager.relay self, :deleted, m end end end + + source.go_idle rescue SourceError => e warn "problem getting messages from #{source}: #{e.message}" end end