diff options
| author | Stan Hu <stanhu@gmail.com> | 2016-04-11 23:07:06 -0700 |
|---|---|---|
| committer | Stan Hu <stanhu@gmail.com> | 2016-04-11 23:07:06 -0700 |
| commit | c162e0278cb845f6209e926d49474926b6a45956 (patch) | |
| tree | ca1235a19d5d772962c068ea226933ac9c938730 /app/models | |
| parent | 93cfc0b25eca08ad5215d48bf14095e378bb54a4 (diff) | |
| download | gitlab-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.rb | 10 |
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 |
