summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2016-04-11 23:07:06 -0700
committerStan Hu <stanhu@gmail.com>2016-04-11 23:07:06 -0700
commitc162e0278cb845f6209e926d49474926b6a45956 (patch)
treeca1235a19d5d772962c068ea226933ac9c938730 /app/models
parent93cfc0b25eca08ad5215d48bf14095e378bb54a4 (diff)
downloadgitlab-ce-c162e0278cb845f6209e926d49474926b6a45956.tar.gz
Check and report import job status to help diagnose issues with forking
Diffstat (limited to 'app/models')
-rw-r--r--app/models/project.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index 3e1f04b4158..6298dc8d1c8 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -388,9 +388,15 @@ class Project < ActiveRecord::Base
def add_import_job
if forked?
- RepositoryForkWorker.perform_async(self.id, forked_from_project.path_with_namespace, self.namespace.path)
+ job_id = RepositoryForkWorker.perform_async(self.id, forked_from_project.path_with_namespace, self.namespace.path)
else
- RepositoryImportWorker.perform_async(self.id)
+ job_id = RepositoryImportWorker.perform_async(self.id)
+ end
+
+ if job_id
+ Rails.logger.info "Import job started for #{path_with_namespace} with job ID #{job_id}"
+ else
+ Rails.logger.error "Import job failed to start for #{path_with_namespace}"
end
end