diff options
author | Rémy Coutable <remy@rymai.me> | 2017-10-05 11:46:30 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-10-05 11:48:26 +0300 |
commit | f50b95b00790794184243062e3cbc9095b8b839d (patch) | |
tree | 15806f1cd971c44876eced5e9c3fb277b230ee95 | |
parent | a55e150177934145c3daeecb678cce1b16f0a3b8 (diff) |
Ensure the `import:github` task doesn't schedule an import job
The point of this task is to run the import in the foreground, so it
shouldn't schedule an import job!
Signed-off-by: Rémy Coutable <remy@rymai.me>
-rw-r--r-- | lib/tasks/import.rake | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/tasks/import.rake b/lib/tasks/import.rake index 7243ca85de8..7f86fd7b45e 100644 --- a/lib/tasks/import.rake +++ b/lib/tasks/import.rake @@ -59,18 +59,23 @@ class GithubImport namespace_path, _sep, name = @project_path.rpartition('/') namespace = find_or_create_namespace(namespace_path) - Projects::CreateService.new( + project = Projects::CreateService.new( @current_user, name: name, path: name, description: @repo['description'], namespace_id: namespace.id, visibility_level: visibility_level, - import_type: 'github', - import_source: @repo['full_name'], - import_url: @repo['clone_url'].sub('://', "://#{@options[:token]}@"), skip_wiki: @repo['has_wiki'] ).execute + + project.update!( + import_type: 'github', + import_source: @repo['full_name'], + import_url: @repo['clone_url'].sub('://', "://#{@options[:token]}@") + ) + + project end end |