Class: Projects::LfsPointers::LfsObjectDownloadListService

Inherits:
BaseService
  • Object
show all
Includes:
Gitlab::Utils::StrongMemoize
Defined in:
app/services/projects/lfs_pointers/lfs_object_download_list_service.rb

Constant Summary collapse

HEAD_REV =
'HEAD'
LFS_ENDPOINT_PATTERN =
/^\t?url\s*=\s*(.+)$/
LFS_BATCH_API_ENDPOINT =
'/info/lfs/objects/batch'
LfsObjectDownloadListError =
Class.new(StandardError)

Instance Attribute Summary

Attributes inherited from BaseService

#current_user, #params, #project

Instance Method Summary collapse

Methods inherited from BaseService

#initialize

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

#can?

Constructor Details

This class inherits a constructor from BaseService

Instance Method Details

#each_list_item(&block) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
# File 'app/services/projects/lfs_pointers/lfs_object_download_list_service.rb', line 17

def each_list_item(&block)
  return unless context_valid?

  # Downloading the required information and gathering it inside an
  #   LfsDownloadObject for each oid
  LfsDownloadLinkListService
    .new(project, remote_uri: current_endpoint_uri)
    .each_link(missing_lfs_files, &block)
rescue LfsDownloadLinkListService::DownloadLinksError => e
  raise LfsObjectDownloadListError, "The LFS objects download list couldn't be imported. Error: #{e.message}"
end