Skip to content

Clean up expired Direct Transfer exports

This is a follow-up issue from #408469 (comment 1930624460)

It just means we start to export more things on disk, so we probably need a cron job for direct transfer exports to clean up old exports. We do the cleanup for file-based, but I don't think we do for DT. (emphasis mine)

The exports associated with file-based exports are pruned in Gitlab::Export::PruneProjectExportJobsWorker & Projects::ImportExport::PruneExpiredExportJobsService.

We need to either update these create equivalent workers & cron schedule to handle exports generated by Direct Transfer.

I think the key logic is:

BulkImports::Export.where(created_at: ..1.week.ago).each(&:remove_existing_upload!)
  • The existing logic for starting a new export removes the attached file, but keeps the BulkImports::Export record itself.
  • 7 days matches the expiry defined in ProjectExportJob
Edited by James Nutt
OSZAR »