only sleep on backfill nulls if updates are made
Change-Id: Ia7183a8de2aae2c8e3992d1378efc2861b41ea9d Reviewed-on: https://gerrit.instructure.com/202452 Tested-by: Jenkins Reviewed-by: Cody Cutrer <cody@instructure.com> QA-Review: Cody Cutrer <cody@instructure.com> Product-Review: Cody Cutrer <cody@instructure.com>
This commit is contained in:
parent
920391503f
commit
2ca5530ff7
|
@ -49,9 +49,9 @@ module DataFixup
|
|||
end
|
||||
|
||||
klass.find_ids_in_ranges(batch_size: batch_size) do |start_id, end_id|
|
||||
scope.where(id: start_id..end_id).update_all(updates)
|
||||
update_count = scope.where(id: start_id..end_id).update_all(updates)
|
||||
sleep_interval_per_batch = Setting.get("sleep_interval_per_backfill_nulls_batch", nil).presence&.to_f
|
||||
sleep(sleep_interval_per_batch) if sleep_interval_per_batch
|
||||
sleep(sleep_interval_per_batch) if update_count > 0 && sleep_interval_per_batch
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue