BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
c98add15
Commit
c98add15
authored
Apr 10, 2017
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'clean_carrierwave_tempfiles' into 'master'
Clean carrierwave tempfiles Closes #28540 See merge request !9466
parents
01adf920
ad27f204
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
5 deletions
+28
-5
file_uploader.rb
app/uploaders/file_uploader.rb
+0
-4
clean_carrierwave_tempfiles.yml
changelogs/unreleased/clean_carrierwave_tempfiles.yml
+4
-0
20170408033905_remove_old_cache_directories.rb
...st_migrate/20170408033905_remove_old_cache_directories.rb
+23
-0
schema.rb
db/schema.rb
+1
-1
No files found.
app/uploaders/file_uploader.rb
View file @
c98add15
...
...
@@ -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 @
c98add15
---
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 @
c98add15
# 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 @
c98add15
...
...
@@ -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