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
Boxiang Sun
gitlab-ce
Commits
bc8eebf0
Commit
bc8eebf0
authored
May 04, 2016
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add export worker to process project export async
parent
1990616a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
0 deletions
+23
-0
app/models/project.rb
app/models/project.rb
+10
-0
app/workers/project_export_worker.rb
app/workers/project_export_worker.rb
+13
-0
No files found.
app/models/project.rb
View file @
bc8eebf0
...
...
@@ -1034,4 +1034,14 @@ class Project < ActiveRecord::Base
def
wiki
@wiki
||=
ProjectWiki
.
new
(
self
,
self
.
owner
)
end
def
add_export_job
(
current_user_id
:)
job_id
=
ProjectExportWorker
.
perform_async
(
current_user_id
,
self
.
id
)
if
job_id
Rails
.
logger
.
info
"Export job started for project ID
#{
self
.
id
}
with job ID
#{
job_id
}
"
else
Rails
.
logger
.
error
"Export job failed to start for project ID
#{
self
.
id
}
"
end
end
end
app/workers/project_export_worker.rb
0 → 100644
View file @
bc8eebf0
class
ProjectExportWorker
include
Sidekiq
::
Worker
# TODO: enabled 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
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