Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
ad27f204
Commit
ad27f204
authored
Apr 10, 2017
by
blackst0ne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Periodically clean up temporary upload files to recover storage space
parent
01adf920
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
5 deletions
+28
-5
app/uploaders/file_uploader.rb
app/uploaders/file_uploader.rb
+0
-4
changelogs/unreleased/clean_carrierwave_tempfiles.yml
changelogs/unreleased/clean_carrierwave_tempfiles.yml
+4
-0
db/post_migrate/20170408033905_remove_old_cache_directories.rb
...st_migrate/20170408033905_remove_old_cache_directories.rb
+23
-0
db/schema.rb
db/schema.rb
+1
-1
No files found.
app/uploaders/file_uploader.rb
View file @
ad27f204
...
...
@@ -38,10 +38,6 @@ class FileUploader < GitlabUploader
File
.
join
(
dynamic_path_segment
,
@secret
)
end
def
cache_dir
File
.
join
(
base_dir
,
'tmp'
,
@project
.
path_with_namespace
,
@secret
)
end
def
model
project
end
...
...
changelogs/unreleased/clean_carrierwave_tempfiles.yml
0 → 100644
View file @
ad27f204
---
title
:
Periodically clean up temporary upload files to recover storage space
merge_request
:
9466
author
:
blackst0ne
db/post_migrate/20170408033905_remove_old_cache_directories.rb
0 → 100644
View file @
ad27f204
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
# Remove all files from old custom carrierwave's cache directories.
# See https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/9466
class
RemoveOldCacheDirectories
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
def
up
# FileUploader cache.
FileUtils
.
rm_rf
(
Dir
[
Rails
.
root
.
join
(
'public'
,
'uploads'
,
'tmp'
,
'*'
)])
end
def
down
# Old cache is not supposed to be recoverable.
# So the down method is empty.
end
end
db/schema.rb
View file @
ad27f204
...
...
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
2017040
7140450
)
do
ActiveRecord
::
Schema
.
define
(
version:
2017040
8033905
)
do
# These are extensions that must be enabled in order to support this database
enable_extension
"plpgsql"
enable_extension
"pg_trgm"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment