diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-30 18:08:03 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-30 18:08:03 +0300 |
commit | 02c48d0a6bf00afd66a603253ec59db4e1412392 (patch) | |
tree | 0b7ea896f1f535e55e1988f4cb8d105e3983ea7c /app/models/projects | |
parent | f1284938edfc2e033baf2c26ebadf42c526f6432 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/projects')
-rw-r--r-- | app/models/projects/build_artifacts_size_refresh.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/models/projects/build_artifacts_size_refresh.rb b/app/models/projects/build_artifacts_size_refresh.rb index f411dbe88ed..c92898068c3 100644 --- a/app/models/projects/build_artifacts_size_refresh.rb +++ b/app/models/projects/build_artifacts_size_refresh.rb @@ -36,6 +36,7 @@ module Projects before_transition created: :running do |refresh| refresh.reset_project_statistics! refresh.refresh_started_at = Time.zone.now + refresh.last_job_artifact_id_on_refresh_start = refresh.project.job_artifacts.last&.id end before_transition running: any do |refresh, transition| @@ -83,9 +84,9 @@ module Projects def next_batch(limit:) project.job_artifacts.select(:id, :size) - .created_at_before(refresh_started_at) + .id_before(last_job_artifact_id_on_refresh_start) .id_after(last_job_artifact_id.to_i) - .ordered_by_created_at_and_id_asc + .ordered_by_id .limit(limit) end |