Skip to content
Snippets Groups Projects

BG migration to fix incorrect job artifacts expire_at on self-managed

Merged Albert requested to merge 355833-migration-to-fix-incorrect-expire-at into master
1 file
+ 4
5
Compare changes
  • Side-by-side
  • Inline
@@ -28,12 +28,11 @@ class RemoveBackfilledJobArtifactsExpireAt < BatchedMigrationJob
def perform
each_sub_batch(
operation_name: :update_all,
batching_scope: ->(relation) do
relation.where(EXPIRES_ON_21_22_23_AT_MIDNIGHT_IN_TIMEZONE).or(relation.where(file_type: 3))
end
operation_name: :update_all
) do |sub_batch|
sub_batch.update_all(expire_at: nil)
sub_batch.where(EXPIRES_ON_21_22_23_AT_MIDNIGHT_IN_TIMEZONE)
.or(sub_batch.where(file_type: 3))
.update_all(expire_at: nil)
end
end
end
Loading