diff options
author | Alexis Reigel <mail@koffeinfrei.org> | 2017-06-22 15:18:01 +0300 |
---|---|---|
committer | Alexis Reigel <mail@koffeinfrei.org> | 2017-07-27 16:43:36 +0300 |
commit | 9816856d055b33de9c47d9e3b73c4acb99c5b5e6 (patch) | |
tree | ae3b0c3b89c008830eb42e2d89713247c6e4a7be /app/models/gpg_key.rb | |
parent | 9d30a80d24a583aad267a8a11f685058eab2c864 (diff) |
perform signature update in sidekiq worker
Diffstat (limited to 'app/models/gpg_key.rb')
-rw-r--r-- | app/models/gpg_key.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/models/gpg_key.rb b/app/models/gpg_key.rb index ec30658e7ea..a444792581a 100644 --- a/app/models/gpg_key.rb +++ b/app/models/gpg_key.rb @@ -28,7 +28,7 @@ class GpgKey < ActiveRecord::Base unless: -> { errors.has_key?(:key) } before_validation :extract_fingerprint, :extract_primary_keyid - after_create :update_invalid_gpg_signatures + after_create :update_invalid_gpg_signatures_after_create after_create :notify_user def key=(value) @@ -54,7 +54,7 @@ class GpgKey < ActiveRecord::Base end def update_invalid_gpg_signatures - Gitlab::Gpg::InvalidGpgSignatureUpdater.new(self).run + InvalidGpgSignatureUpdateWorker.perform_async(self.id) end private @@ -74,4 +74,8 @@ class GpgKey < ActiveRecord::Base def notify_user run_after_commit { NotificationService.new.new_gpg_key(self) } end + + def update_invalid_gpg_signatures_after_create + run_after_commit { update_invalid_gpg_signatures } + end end |