summaryrefslogtreecommitdiff
path: root/app/workers/concerns/dependency_proxy/expireable.rb
blob: 7e37db36bef09092a1d0fb0f46e4616bb59f4748 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# frozen_string_literal: true

module DependencyProxy
  module Expireable
    extend ActiveSupport::Concern

    UPDATE_BATCH_SIZE = 100

    private

    def expire_artifacts(collection)
      collection.each_batch(of: UPDATE_BATCH_SIZE) do |batch|
        batch.update_all(status: :pending_destruction)
      end
    end
  end
end