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

This commit is contained in:
Rubén Dávila 2017-10-05 08:24:27 -05:00
parent 6e0a4fc10e
commit bd8e3606a2

View file

@ -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