Commit f9baaf84 authored by Toon Claes's avatar Toon Claes

Do not query for event logs if no gaps are found

parent 0439ded3
......@@ -51,6 +51,7 @@ module Gitlab
redis.zremrangebyscore(GEO_EVENT_LOG_GAPS, '-inf', outdated_timestamp)
gap_ids = redis.zrangebyscore(GEO_EVENT_LOG_GAPS, '-inf', grace_timestamp).map(&:to_i)
break if gap_ids.empty?
::Geo::EventLog.where(id: gap_ids).each_batch do |batch|
batch.includes_events.each { |event_log| yield event_log }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment