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
cffae0d2
Commit
cffae0d2
authored
May 11, 2016
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixing more export problems
parent
49e6fc40
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
8 deletions
+7
-8
export_service.rb
app/services/projects/import_export/export_service.rb
+1
-1
project_export_worker.rb
app/workers/project_export_worker.rb
+1
-2
saver.rb
lib/gitlab/import_export/saver.rb
+5
-5
No files found.
app/services/projects/import_export/export_service.rb
View file @
cffae0d2
...
...
@@ -27,7 +27,7 @@ module Projects
end
def
notify_worker
raise
Gitlab
::
ImportExport
::
Error
@shared
.
errors
.
join
(
', '
)
raise
Gitlab
::
ImportExport
::
Error
.
new
(
@shared
.
errors
.
join
(
', '
)
)
end
end
end
...
...
app/workers/project_export_worker.rb
View file @
cffae0d2
class
ProjectExportWorker
include
Sidekiq
::
Worker
# TODO: enable
d
retry - disabled for QA purposes
# TODO: enable retry - disabled for QA purposes
sidekiq_options
queue: :gitlab_shell
,
retry:
false
def
perform
(
current_user_id
,
project_id
)
current_user
=
User
.
find
(
current_user_id
)
project
=
Project
.
find
(
project_id
)
::
Projects
::
ImportExport
::
ExportService
.
new
(
project
,
current_user
).
execute
# TODO : Handle errors
end
end
lib/gitlab/import_export/saver.rb
View file @
cffae0d2
...
...
@@ -13,7 +13,7 @@ module Gitlab
def
save
if
compress_and_save
remove_
storage
_path
remove_
export
_path
Rails
.
logger
.
info
(
"Saved project export
#{
archive_file
}
"
)
archive_file
else
...
...
@@ -27,15 +27,15 @@ module Gitlab
private
def
compress_and_save
tar_czf
(
archive:
archive_file
,
dir:
@shared
.
storage
_path
)
tar_czf
(
archive:
archive_file
,
dir:
@shared
.
export
_path
)
end
def
remove_
storage
_path
FileUtils
.
rm_rf
(
@shared
.
storage
_path
)
def
remove_
export
_path
FileUtils
.
rm_rf
(
@shared
.
export
_path
)
end
def
archive_file
@archive_file
||=
File
.
join
(
@shared
.
storage
_path
,
'..'
,
"
#{
Time
.
now
.
strftime
(
'%Y-%m-%d_%H-%M-%3N'
)
}
_project_export.tar.gz"
)
@archive_file
||=
File
.
join
(
@shared
.
export
_path
,
'..'
,
"
#{
Time
.
now
.
strftime
(
'%Y-%m-%d_%H-%M-%3N'
)
}
_project_export.tar.gz"
)
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