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
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
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
8 deletions
+7
-8
app/services/projects/import_export/export_service.rb
app/services/projects/import_export/export_service.rb
+1
-1
app/workers/project_export_worker.rb
app/workers/project_export_worker.rb
+1
-2
lib/gitlab/import_export/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