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
Jérome Perrin
gitlab-ce
Commits
68aca6f6
Commit
68aca6f6
authored
May 11, 2016
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trying to fix timing issue with import status
parent
1322c981
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
app/controllers/projects/imports_controller.rb
app/controllers/projects/imports_controller.rb
+4
-1
app/models/project.rb
app/models/project.rb
+0
-5
app/services/projects/create_service.rb
app/services/projects/create_service.rb
+4
-2
No files found.
app/controllers/projects/imports_controller.rb
View file @
68aca6f6
...
...
@@ -19,7 +19,10 @@ class Projects::ImportsController < Projects::ApplicationController
if
@project
.
import_failed?
@project
.
import_retry
else
@project
.
import_start
Project
.
transaction
do
@project
.
import_start
end
@project
.
add_import_job
if
@project
.
persisted?
end
end
...
...
app/models/project.rb
View file @
68aca6f6
...
...
@@ -246,7 +246,6 @@ class Project < ActiveRecord::Base
state
:finished
state
:failed
after_transition
any
=>
:started
,
do: :schedule_add_import_job
after_transition
any
=>
:finished
,
do: :clear_import_data
end
...
...
@@ -385,10 +384,6 @@ class Project < ActiveRecord::Base
id
&&
persisted?
end
def
schedule_add_import_job
run_after_commit
(
:add_import_job
)
end
def
add_import_job
if
forked?
job_id
=
RepositoryForkWorker
.
perform_async
(
self
.
id
,
forked_from_project
.
path_with_namespace
,
self
.
namespace
.
path
)
...
...
app/services/projects/create_service.rb
View file @
68aca6f6
...
...
@@ -59,6 +59,10 @@ module Projects
end
end
Project
.
transaction
do
@project
.
import_start
if
@project
.
import?
end
after_create_actions
if
@project
.
persisted?
@project
...
...
@@ -95,8 +99,6 @@ module Projects
unless
@project
.
group
@project
.
team
<<
[
current_user
,
:master
,
current_user
]
end
@project
.
import_start
if
@project
.
import?
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