summaryrefslogtreecommitdiff
path: root/app/workers/create_gpg_signature_worker.rb
blob: a2da1bda11fc507fbd04a5ad8f0e38a9b09035ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# frozen_string_literal: true

class CreateGpgSignatureWorker
  include ApplicationWorker

  def perform(commit_sha, project_id)
    project = Project.find_by(id: project_id)
    return unless project

    commit = project.commit(commit_sha)

    return unless commit

    # This calculates and caches the signature in the database
    Gitlab::Gpg::Commit.new(commit).signature
  end
end