Clean carrierwave tempfiles
What does this MR do?
It adds a cron job for cleaning tempfiles created by carrierwave
gem.
Are there points in the code the reviewer needs to double check?
Carrierwave has its own method to clean tempfiles, but it works only if cache_dir
is set by default.
In GitLab cache_dir
is being redefined per project in file_uploader.rb so CarrierWave.clean_cached_files!
doesn't work.
Why was this MR needed?
Tempfiles are created every time when a file is being uploaded.
Does this MR meet the acceptance criteria?
-
Changelog entry added -
Documentation created/updated -
API support added - Tests
-
Added for this feature/bug -
All builds are passing
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Branch has no merge conflicts with master
(if it does - rebase it please) -
Squashed related commits together
What are the relevant issue numbers?
Closes #28540 (closed)
Merge request reports
Activity
added 2 commits
added 176 commits
-
2b63a3df...e7a64ec3 - 175 commits from branch
gitlab-org:master
- 1a32fd2d - Add cron job to clean carrierwave's temfiles
-
2b63a3df...e7a64ec3 - 175 commits from branch
@rspeicher, could you review the code, please?
- Resolved by username-removed-86853
added 6 commits
- bffb0c87 - Changed README.md
- f115595d - Add cron job to clean carrierwave's temfiles
- a600169d - Reverted changes in README
- 2b63a3df - Added merge request to changelog entry
- 8a5200ce - Added with_deleted scope to Project
- 40807295 - Merge branch 'clean_carrierwave_tempfiles' of gitlab.com:blackst0ne/gitlab-ce in…
Toggle commit list- Resolved by username-removed-86853
assigned to @rymai
- Resolved by username-removed-86853
- Resolved by username-removed-86853
assigned to @blackst0ne
@rymai, if we decide to use carrierwave's built-in cleaning method, the old
cache_dir
s should be removed.
I see two ways to get this:- Add an initializer where those directories will be checked and removed. This initializer should exist some releases because there are users who don't upgrade their gitlab instances every release. We'll remove that initializer later.
- Let users remove that directories by themselves by pointing that out in
upgrade to 9.0 release
document as a separate item of upgrading process.
@rymai, I can't got further until you tell me what the right way it is as a GitLab core member. =)