diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-22 00:08:57 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-22 00:08:57 +0300 |
commit | a6c2be7cd20a9515b347e72d63c5b47bb9b79457 (patch) | |
tree | 568212b4debeb2a35bb1133209b98e1468d9ee85 /app/services/projects | |
parent | 74a2d57b337034cfdcd719615e4da06643b69114 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/projects')
-rw-r--r-- | app/services/projects/lfs_pointers/lfs_link_service.rb | 4 | ||||
-rw-r--r-- | app/services/projects/update_pages_service.rb | 4 |
2 files changed, 3 insertions, 5 deletions
diff --git a/app/services/projects/lfs_pointers/lfs_link_service.rb b/app/services/projects/lfs_pointers/lfs_link_service.rb index a05c76f5e85..39cd553261f 100644 --- a/app/services/projects/lfs_pointers/lfs_link_service.rb +++ b/app/services/projects/lfs_pointers/lfs_link_service.rb @@ -25,7 +25,6 @@ module Projects private - # rubocop: disable CodeReuse/ActiveRecord def link_existing_lfs_objects(oids) linked_existing_objects = [] iterations = 0 @@ -33,7 +32,7 @@ module Projects oids.each_slice(BATCH_SIZE) do |oids_batch| # Load all existing LFS Objects immediately so we don't issue an extra # query for the `.any?` - existent_lfs_objects = LfsObject.where(oid: oids_batch).load + existent_lfs_objects = LfsObject.for_oids(oids_batch).load next unless existent_lfs_objects.any? rows = existent_lfs_objects @@ -49,7 +48,6 @@ module Projects linked_existing_objects end - # rubocop: enable CodeReuse/ActiveRecord def log_lfs_link_results(lfs_objects_linked_count, iterations) Gitlab::Import::Logger.info( diff --git a/app/services/projects/update_pages_service.rb b/app/services/projects/update_pages_service.rb index 8b23f610ad1..59389a0fa65 100644 --- a/app/services/projects/update_pages_service.rb +++ b/app/services/projects/update_pages_service.rb @@ -27,7 +27,7 @@ module Projects @status.run! raise InvalidStateError, 'missing pages artifacts' unless build.artifacts? - raise InvalidStateError, 'pages are outdated' unless latest? + raise InvalidStateError, 'build SHA is outdated for this ref' unless latest? # Create temporary directory in which we will extract the artifacts make_secure_tmp_dir(tmp_path) do |archive_path| @@ -36,7 +36,7 @@ module Projects # Check if we did extract public directory archive_public_path = File.join(archive_path, PUBLIC_DIR) raise InvalidStateError, 'pages miss the public folder' unless Dir.exist?(archive_public_path) - raise InvalidStateError, 'pages are outdated' unless latest? + raise InvalidStateError, 'build SHA is outdated for this ref' unless latest? deploy_page!(archive_public_path) success |