summaryrefslogtreecommitdiff
path: root/app/workers/concerns/dependency_proxy/expireable.rb
blob: 9650ac85c6c5a7ecaa8c8d906783df14cad2949f (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: :expired)
      end
    end
  end
end