Fix query that fetches projects that aren't synced yet

parent 820fcc30
...@@ -3,6 +3,7 @@ class GeoBackfillWorker ...@@ -3,6 +3,7 @@ class GeoBackfillWorker
include CronjobQueue include CronjobQueue
RUN_TIME = 5.minutes.to_i.freeze RUN_TIME = 5.minutes.to_i.freeze
BATCH_SIZE = 100.freeze
def perform def perform
start = Time.now start = Time.now
...@@ -30,8 +31,8 @@ class GeoBackfillWorker ...@@ -30,8 +31,8 @@ class GeoBackfillWorker
def find_project_ids def find_project_ids
return [] if Project.count == Geo::ProjectRegistry.count return [] if Project.count == Geo::ProjectRegistry.count
Project.where.not(id: Geo::ProjectRegistry.pluck(:id)) Project.where.not(id: Geo::ProjectRegistry.pluck(:project_id))
.limit(100) .limit(BATCH_SIZE)
.pluck(:id) .pluck(:id)
end end
......
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