Skip to content
Snippets Groups Projects

Phase 2 enqueuer

Merged Steve Abrams requested to merge 349744-phase2-enqueuer into master
2 files
+ 6
7
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -34,12 +34,11 @@ def perform
container_repository_id: next_repository.id,
import_type: 'next'
)
puts next_repository.errors.full_messages
true
end
rescue StandardError
next_repository&.abort_import
# rescue StandardError
# next_repository&.abort_import
end
private
@@ -48,7 +47,7 @@ def tag_count_too_high?
return false unless next_repository.tags_count > migration.max_tags_count
next_repository.skip_import(reason: :too_many_tags)
puts next_repository.errors.full_messages
true
end
@@ -69,13 +68,13 @@ def waiting_time_passed?
def next_repository
strong_memoize(:next_repository) do
ContainerRepository.ready_for_import.take
ContainerRepository.ready_for_import.take # rubocop:disable CodeReuse/ActiveRecord
end
end
def next_aborted_repository
strong_memoize(:next_aborted_repository) do
ContainerRepository.aborted_imports.take
ContainerRepository.aborted_imports.take # rubocop:disable CodeReuse/ActiveRecord
end
end
Loading