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
3524a618
Commit
3524a618
authored
Mar 01, 2019
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve migration/rollback logic for attachments
parent
61d77a04
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
+14
-6
app/services/projects/hashed_storage/migrate_attachments_service.rb
...es/projects/hashed_storage/migrate_attachments_service.rb
+7
-3
app/services/projects/hashed_storage/rollback_attachments_service.rb
...s/projects/hashed_storage/rollback_attachments_service.rb
+7
-3
No files found.
app/services/projects/hashed_storage/migrate_attachments_service.rb
View file @
3524a618
...
...
@@ -22,10 +22,14 @@ module Projects
@new_disk_path
=
project
.
disk_path
result
=
move_folder!
(
origin
,
target
)
if
result
project
.
save!
if
result
&&
block_given?
yield
yield
if
block_given?
else
# Rollback changes
project
.
rollback!
end
result
...
...
app/services/projects/hashed_storage/rollback_attachments_service.rb
View file @
3524a618
...
...
@@ -17,10 +17,14 @@ module Projects
@new_disk_path
=
FileUploader
.
base_dir
(
project
)
result
=
move_folder!
(
origin
,
target
)
if
result
project
.
save!
if
result
&&
block_given?
yield
yield
if
block_given?
else
# Rollback changes
project
.
rollback!
end
result
...
...
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