diff options
author | Rubén Dávila <ruben@gitlab.com> | 2017-10-05 08:24:27 -0500 |
---|---|---|
committer | Rubén Dávila <ruben@gitlab.com> | 2017-10-05 08:26:24 -0500 |
commit | bd8e3606a202273129b963742aa071a0d2c8812f (patch) | |
tree | 71580383e16371b2451228a5ea1c1cd25d1b835c /lib | |
parent | 6e0a4fc10e745f8d8be65f8ee420c75d36057c16 (diff) | |
download | gitlab-ce-bd8e3606a202273129b963742aa071a0d2c8812f.tar.gz |
Don't call update signature worker when there aren't subkeys
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/background_migration/create_gpg_key_subkeys_from_gpg_keys.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/gitlab/background_migration/create_gpg_key_subkeys_from_gpg_keys.rb b/lib/gitlab/background_migration/create_gpg_key_subkeys_from_gpg_keys.rb index 3a32134b991..e94719db72e 100644 --- a/lib/gitlab/background_migration/create_gpg_key_subkeys_from_gpg_keys.rb +++ b/lib/gitlab/background_migration/create_gpg_key_subkeys_from_gpg_keys.rb @@ -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 |