Commit Graph

9 Commits

Author SHA1 Message Date
GitLab Bot 48e26d30fd Add latest changes from gitlab-org/gitlab@master 2020-09-11 18:08:42 +00:00
GitLab Bot 2399724614 Add latest changes from gitlab-org/gitlab@master 2020-01-21 03:08:37 +00:00
GitLab Bot b3e4ec8e8a Add latest changes from gitlab-org/gitlab@master 2019-10-23 09:06:03 +00:00
GitLab Bot 427b23c127 Add latest changes from gitlab-org/gitlab@master 2019-10-03 00:05:59 +00:00
Thong Kuah f0391c2517 Add frozen_string_literal to spec/support
Using the sed script from
https://gitlab.com/gitlab-org/gitlab-ce/issues/59758
2019-07-25 17:33:34 +12:00
Jan Provaznik c3782d20af
Remove fast_destroy_uploads feature flag
Fast destroy of uploads was successfully enabled and test.
2019-02-12 12:30:27 -02:00
Jan Provaznik 9ccf8d032f Enabled feature flag for fast deletions
Fast destroy is used only if the feature flag is enabled, otherwise
uploads are still deleted using carrier wave. It's disabled by default.
2018-12-06 22:00:19 +01:00
Jan Provaznik 239fdc78b1 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.
2018-12-06 22:00:19 +01:00
Jan Provaznik 7da3b2cdd0 Delete remote uploads
ObjectStore uploader requires presence of associated `uploads` record
when deleting the upload file (through the carrierwave's after_commit
hook) because we keep info whether file is LOCAL or REMOTE in `upload`
object.

For this reason we can not destroy uploads as "dependent: :destroy" hook
because these would be deleted too soon. Instead we rely on
carrierwave's hook to destroy `uploads` in after_commit hook.

But in before_destroy hook we still have to delete not-mounted uploads
(which don't use carrierwave's destroy hook). This has to be done in
before_Destroy instead of after_commit because `FileUpload` requires
existence of model's object on destroy action.

This is not ideal state of things, in a next step we should investigate
how to unify model dependencies so we can use same workflow for all
uploads.

Related to #45425
2018-05-16 08:58:07 +02:00