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
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
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
0 deletions
+23
-0
project.rb
app/models/project.rb
+10
-0
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