Class: Import::ImportFileCleanupService

Inherits:
Object
  • Object
show all
Defined in:
app/services/import/import_file_cleanup_service.rb

Constant Summary collapse

LAST_MODIFIED =
72.hours
BATCH_SIZE =
100

Instance Method Summary collapse

Instance Method Details

#executeObject



8
9
10
11
12
13
14
15
16
17
# File 'app/services/import/import_file_cleanup_service.rb', line 8

def execute
  ImportExportUpload
    .with_import_file
    .updated_before(LAST_MODIFIED.ago)
    .each_batch(of: BATCH_SIZE) do |batch|
    batch.each do |upload|
      ::Gitlab::Import::RemoveImportFileWorker.perform_async(upload.id)
    end
  end
end