2018-10-07 14:31:08 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Uploads
|
|
|
|
class Base
|
|
|
|
BATCH_SIZE = 100
|
|
|
|
|
|
|
|
attr_reader :logger
|
|
|
|
|
|
|
|
def initialize(logger: nil)
|
2020-01-27 16:08:47 -05:00
|
|
|
@logger = Rails.logger # rubocop:disable Gitlab/RailsLogger
|
2018-10-07 14:31:08 -04:00
|
|
|
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
|