Commit b15c90c7 authored by Alex Ives's avatar Alex Ives

Refactor skippable? as registry_exists?

Relates to https://gitlab.com/gitlab-org/gitlab/issues/232516
parent e636e3fe
...@@ -23,7 +23,7 @@ module Gitlab ...@@ -23,7 +23,7 @@ module Gitlab
end end
# rubocop: enable CodeReuse/ActiveRecord # rubocop: enable CodeReuse/ActiveRecord
def skippable? def registry_exists?
registry.new_record? registry.new_record?
end end
......
...@@ -23,11 +23,11 @@ module Gitlab ...@@ -23,11 +23,11 @@ module Gitlab
'Cache invalidation', 'Cache invalidation',
cache_key: event.key, cache_key: event.key,
cache_expired: expired, cache_expired: expired,
skippable: skippable? skippable: registry_exists?
) )
end end
def skippable? def registry_exists?
false false
end end
end end
......
...@@ -10,7 +10,7 @@ module Gitlab ...@@ -10,7 +10,7 @@ module Gitlab
def process def process
return unless event.project_id return unless event.project_id
job_id = hashed_storage_migrate unless skippable? job_id = hashed_storage_migrate unless registry_exists?
log_event(job_id) log_event(job_id)
end end
...@@ -34,7 +34,7 @@ module Gitlab ...@@ -34,7 +34,7 @@ module Gitlab
new_storage_version: event.new_storage_version, new_storage_version: event.new_storage_version,
old_disk_path: event.old_disk_path, old_disk_path: event.old_disk_path,
new_disk_path: event.new_disk_path, new_disk_path: event.new_disk_path,
skippable: skippable?, skippable: registry_exists?,
job_id: job_id) job_id: job_id)
end end
end end
......
...@@ -10,7 +10,7 @@ module Gitlab ...@@ -10,7 +10,7 @@ module Gitlab
def process def process
job_id = nil job_id = nil
unless skippable? unless registry_exists?
job_id = destroy_repository job_id = destroy_repository
end end
...@@ -35,7 +35,7 @@ module Gitlab ...@@ -35,7 +35,7 @@ module Gitlab
project_id: event.project_id, project_id: event.project_id,
repository_storage_name: event.repository_storage_name, repository_storage_name: event.repository_storage_name,
disk_path: event.deleted_path, disk_path: event.deleted_path,
skippable: skippable?, skippable: registry_exists?,
job_id: job_id) job_id: job_id)
end end
end end
......
...@@ -10,7 +10,7 @@ module Gitlab ...@@ -10,7 +10,7 @@ module Gitlab
def process def process
return unless event.project_id return unless event.project_id
job_id = rename_repository unless skippable? job_id = rename_repository unless registry_exists?
log_event(job_id) log_event(job_id)
end end
...@@ -31,7 +31,7 @@ module Gitlab ...@@ -31,7 +31,7 @@ module Gitlab
project_id: event.project_id, project_id: event.project_id,
old_path: event.old_path_with_namespace, old_path: event.old_path_with_namespace,
new_path: event.new_path_with_namespace, new_path: event.new_path_with_namespace,
skippable: skippable?, skippable: registry_exists?,
job_id: job_id) job_id: job_id)
end end
end end
......
...@@ -8,12 +8,12 @@ module Gitlab ...@@ -8,12 +8,12 @@ module Gitlab
include BaseEvent include BaseEvent
def process def process
registry.reset_checksum! unless skippable? registry.reset_checksum! unless registry_exists?
log_event( log_event(
'Reset checksum', 'Reset checksum',
project_id: event.project_id, project_id: event.project_id,
skippable: skippable?) skippable: registry_exists?)
end end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment