Class: Projects::ImportService
- Inherits:
-
BaseService
- Object
- BaseService
- Projects::ImportService
- Defined in:
- app/services/projects/import_service.rb
Constant Summary collapse
- Error =
Class.new(StandardError)
- PermissionError =
Class.new(StandardError)
Instance Attribute Summary
Attributes inherited from BaseService
#current_user, #params, #project
Instance Method Summary collapse
-
#async? ⇒ Boolean
Returns true if this importer is supposed to perform its work in the background.
- #execute ⇒ Object
Methods inherited from BaseService
Methods included from BaseServiceUtility
#deny_visibility_level, #event_service, #log_error, #log_info, #notification_service, #system_hook_service, #todo_service, #visibility_level
Methods included from Gitlab::Allowable
Constructor Details
This class inherits a constructor from BaseService
Instance Method Details
#async? ⇒ Boolean
Returns true if this importer is supposed to perform its work in the background.
This method will only return ‘true` if async importing is explicitly supported by an importer class (`Gitlab::GithubImport::ParallelImporter` for example).
14 15 16 |
# File 'app/services/projects/import_service.rb', line 14 def async? has_importer? && !!importer_class.try(:async?) end |
#execute ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'app/services/projects/import_service.rb', line 18 def execute track_start_import add_repository_to_project validate_repository_size! download_lfs_objects import_data after_execute_hook success rescue Gitlab::HTTP_V2::UrlBlocker::BlockedUrlError, StandardError => e Gitlab::Import::ImportFailureService.track( project_id: project.id, error_source: self.class.name, exception: e, metrics: true ) = Projects::ImportErrorFilter.(e.) error( s_( "ImportProjects|Error importing repository %{project_safe_import_url} into %{project_full_path} - %{message}" ) % { project_safe_import_url: project.safe_import_url, project_full_path: project.full_path, message: } ) end |