debian-mirror-gitlab/app/models/uploads/base.rb

20 lines
403 B
Ruby
Raw Normal View History

2019-02-15 15:39:39 +05:30
# frozen_string_literal: true
module Uploads
class Base
BATCH_SIZE = 100
attr_reader :logger
def initialize(logger: nil)
2020-03-13 15:44:24 +05:30
@logger = Rails.logger # rubocop:disable Gitlab/RailsLogger
2019-02-15 15:39:39 +05:30
end
def delete_keys_async(keys_to_delete)
keys_to_delete.each_slice(BATCH_SIZE) do |batch|
DeleteStoredFilesWorker.perform_async(self.class, batch)
end
end
end
end