Commit bd8e3606 authored by Rubén Dávila's avatar Rubén Dávila

Don't call update signature worker when there aren't subkeys

parent 6e0a4fc1
......@@ -26,7 +26,8 @@ class Gitlab::BackgroundMigration::CreateGpgKeySubkeysFromGpgKeys
return if gpg_key.nil?
return if gpg_key.subkeys.any?
create_subkeys(gpg_key) && update_signatures(gpg_key)
create_subkeys(gpg_key)
update_signatures(gpg_key)
end
private
......@@ -45,6 +46,8 @@ class Gitlab::BackgroundMigration::CreateGpgKeySubkeysFromGpgKeys
end
def update_signatures(gpg_key)
return unless gpg_key.subkeys.exists?
InvalidGpgSignatureUpdateWorker.perform_async(gpg_key.id)
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