summaryrefslogtreecommitdiff
path: root/app/workers
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2017-08-16 18:34:55 +0000
committerRobert Speicher <robert@gitlab.com>2017-08-16 18:34:55 +0000
commitec34b2d051c16a351387fbaedb5542654810b8a5 (patch)
treee08e965390b86e187321d83957c99a45190a698a /app/workers
parent72d5165bd57472692c77d6a9d159e65058513bf3 (diff)
parentba7251fefd92b0ecb6365cfe55510e24c5343ac6 (diff)
downloadgitlab-ce-ec34b2d051c16a351387fbaedb5542654810b8a5.tar.gz
Merge branch 'dm-gpg-signature-performance' into 'master'
Only create commit GPG signature when necessary See merge request !13561
Diffstat (limited to 'app/workers')
-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