summaryrefslogtreecommitdiff
path: root/app/workers/create_gpg_signature_worker.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-08-15 13:22:55 +0200
committerDouwe Maan <douwe@selenight.nl>2017-08-16 18:57:50 +0200
commitba7251fefd92b0ecb6365cfe55510e24c5343ac6 (patch)
treed572877f0150efa654849b97896ef769aeff6c0b /app/workers/create_gpg_signature_worker.rb
parent4a2a6d521a260981482ee8e4931ebf06cb4f5b6a (diff)
downloadgitlab-ce-ba7251fefd92b0ecb6365cfe55510e24c5343ac6.tar.gz
Only create commit GPG signature when necessarydm-gpg-signature-performance
Diffstat (limited to 'app/workers/create_gpg_signature_worker.rb')
-rw-r--r--app/workers/create_gpg_signature_worker.rb8
1 files changed, 2 insertions, 6 deletions
diff --git a/app/workers/create_gpg_signature_worker.rb b/app/workers/create_gpg_signature_worker.rb
index 4f47717ff69..f34dff2d656 100644
--- a/app/workers/create_gpg_signature_worker.rb
+++ b/app/workers/create_gpg_signature_worker.rb
@@ -4,13 +4,9 @@ class CreateGpgSignatureWorker
def perform(commit_sha, project_id)
project = Project.find_by(id: project_id)
-
return unless project
- commit = project.commit(commit_sha)
-
- return unless commit
-
- commit.signature
+ # This calculates and caches the signature in the database
+ Gitlab::Gpg::Commit.new(project, commit_sha).signature
end
end