-
- Downloads
There was an error fetching the commit references. Please try again later.
Use FastDestroy for deleting uploads
It gathers list of file paths to delete before destroying the parent object. Then after the parent_object is destroyed these paths are scheduled for deletion asynchronously. Carrierwave needed associated model for deleting upload file. To avoid this requirement, simple Fog/File layer is used directly for file deletion, this allows us to use just a simple list of paths.
Showing
- app/models/concerns/fast_destroy_all.rb 1 addition, 0 deletionsapp/models/concerns/fast_destroy_all.rb
- app/models/concerns/with_uploads.rb 3 additions, 11 deletionsapp/models/concerns/with_uploads.rb
- app/models/upload.rb 19 additions, 0 deletionsapp/models/upload.rb
- app/models/uploads/base.rb 19 additions, 0 deletionsapp/models/uploads/base.rb
- app/models/uploads/fog.rb 43 additions, 0 deletionsapp/models/uploads/fog.rb
- app/models/uploads/local.rb 56 additions, 0 deletionsapp/models/uploads/local.rb
- app/workers/all_queues.yml 1 addition, 0 deletionsapp/workers/all_queues.yml
- app/workers/delete_stored_files_worker.rb 22 additions, 0 deletionsapp/workers/delete_stored_files_worker.rb
- changelogs/unreleased/fast-upload-delete.yml 5 additions, 0 deletionschangelogs/unreleased/fast-upload-delete.yml
- config/sidekiq_queues.yml 1 addition, 0 deletionsconfig/sidekiq_queues.yml
- spec/lib/gitlab/import_export/all_models.yml 1 addition, 0 deletionsspec/lib/gitlab/import_export/all_models.yml
- spec/models/appearance_spec.rb 1 addition, 1 deletionspec/models/appearance_spec.rb
- spec/models/group_spec.rb 1 addition, 1 deletionspec/models/group_spec.rb
- spec/models/project_spec.rb 1 addition, 1 deletionspec/models/project_spec.rb
- spec/models/uploads/fog_spec.rb 69 additions, 0 deletionsspec/models/uploads/fog_spec.rb
- spec/models/uploads/local_spec.rb 45 additions, 0 deletionsspec/models/uploads/local_spec.rb
- spec/models/user_spec.rb 1 addition, 1 deletionspec/models/user_spec.rb
- spec/support/shared_examples/models/with_uploads_shared_examples.rb 33 additions, 7 deletions...rt/shared_examples/models/with_uploads_shared_examples.rb
app/models/uploads/base.rb
0 → 100644
app/models/uploads/fog.rb
0 → 100644
app/models/uploads/local.rb
0 → 100644
app/workers/delete_stored_files_worker.rb
0 → 100644
changelogs/unreleased/fast-upload-delete.yml
0 → 100644
spec/models/uploads/fog_spec.rb
0 → 100644
spec/models/uploads/local_spec.rb
0 → 100644
Please register or sign in to comment