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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
d7584f32
Commit
d7584f32
authored
Jun 20, 2018
by
Micaël Bergeron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ensure the cleanup is run if the upload fails
parent
7525a79f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
8 deletions
+15
-8
app/workers/pseudonymizer_worker.rb
app/workers/pseudonymizer_worker.rb
+8
-4
lib/tasks/gitlab/db.rake
lib/tasks/gitlab/db.rake
+7
-4
No files found.
app/workers/pseudonymizer_worker.rb
View file @
d7584f32
...
...
@@ -3,6 +3,7 @@ class PseudonymizerWorker
include
CronjobQueue
def
perform
abort
"The pseudonymizer is not available with this license."
unless
License
.
feature_available?
(
:pseudonymizer
)
return
unless
Gitlab
::
CurrentSettings
.
pseudonymizer_enabled?
options
=
Pseudonymizer
::
Options
.
new
(
...
...
@@ -11,10 +12,13 @@ class PseudonymizerWorker
)
dumper
=
Pseudonymizer
::
Dumper
.
new
(
options
)
dumper
.
tables_to_csv
uploader
=
Pseudonymizer
::
Uploader
.
new
(
options
,
progress_output:
File
.
open
(
File
::
NULL
,
"w"
))
uploader
.
upload
uploader
.
cleanup
begin
dumper
.
tables_to_csv
uploader
.
upload
ensure
uploader
.
cleanup
end
end
end
lib/tasks/gitlab/db.rake
View file @
d7584f32
...
...
@@ -81,11 +81,14 @@ namespace :gitlab do
)
dumper
=
Pseudonymizer
::
Dumper
.
new
(
options
)
dumper
.
tables_to_csv
uploader
=
Pseudonymizer
::
Uploader
.
new
(
options
)
uploader
.
upload
uploader
.
cleanup
begin
dumper
.
tables_to_csv
uploader
.
upload
ensure
uploader
.
cleanup
end
end
end
end
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