Commit 528e71ae authored by Michael Kozono's avatar Michael Kozono

Merge branch '232516/refactor_skippable_as_registry_exists' into 'master'

Refactor skippable? as registry_exists?

See merge request gitlab-org/gitlab!54735
parents 579dc9d2 b15c90c7
......@@ -23,7 +23,7 @@ module Gitlab
end
# rubocop: enable CodeReuse/ActiveRecord
def skippable?
def registry_exists?
registry.new_record?
end
......
......@@ -23,11 +23,11 @@ module Gitlab
'Cache invalidation',
cache_key: event.key,
cache_expired: expired,
skippable: skippable?
skippable: registry_exists?
)
end
def skippable?
def registry_exists?
false
end
end
......
......@@ -10,7 +10,7 @@ module Gitlab
def process
return unless event.project_id
job_id = hashed_storage_migrate unless skippable?
job_id = hashed_storage_migrate unless registry_exists?
log_event(job_id)
end
......@@ -34,7 +34,7 @@ module Gitlab
new_storage_version: event.new_storage_version,
old_disk_path: event.old_disk_path,
new_disk_path: event.new_disk_path,
skippable: skippable?,
skippable: registry_exists?,
job_id: job_id)
end
end
......
......@@ -10,7 +10,7 @@ module Gitlab
def process
job_id = nil
unless skippable?
unless registry_exists?
job_id = destroy_repository
end
......@@ -35,7 +35,7 @@ module Gitlab
project_id: event.project_id,
repository_storage_name: event.repository_storage_name,
disk_path: event.deleted_path,
skippable: skippable?,
skippable: registry_exists?,
job_id: job_id)
end
end
......
......@@ -10,7 +10,7 @@ module Gitlab
def process
return unless event.project_id
job_id = rename_repository unless skippable?
job_id = rename_repository unless registry_exists?
log_event(job_id)
end
......@@ -31,7 +31,7 @@ module Gitlab
project_id: event.project_id,
old_path: event.old_path_with_namespace,
new_path: event.new_path_with_namespace,
skippable: skippable?,
skippable: registry_exists?,
job_id: job_id)
end
end
......
......@@ -8,12 +8,12 @@ module Gitlab
include BaseEvent
def process
registry.reset_checksum! unless skippable?
registry.reset_checksum! unless registry_exists?
log_event(
'Reset checksum',
project_id: event.project_id,
skippable: skippable?)
skippable: registry_exists?)
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