gitlab-org--gitlab-foss/app/workers/create_gpg_signature_worker.rb

18 lines
388 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2017-07-10 07:19:50 -04:00
class CreateGpgSignatureWorker
include ApplicationWorker
2017-07-10 07:19:50 -04:00
def perform(commit_sha, project_id)
project = Project.find_by(id: project_id)
2017-07-26 10:01:24 -04:00
return unless project
2017-07-10 07:19:50 -04:00
commit = project.commit(commit_sha)
return unless commit
# This calculates and caches the signature in the database
Gitlab::Gpg::Commit.new(commit).signature
2017-07-10 07:19:50 -04:00
end
end