2018-11-08 19:23:39 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
class CreateGpgSignatureWorker
|
2018-03-17 18:26:18 +05:30
|
|
|
include ApplicationWorker
|
2017-09-10 17:25:29 +05:30
|
|
|
|
|
|
|
def perform(commit_sha, project_id)
|
|
|
|
project = Project.find_by(id: project_id)
|
|
|
|
return unless project
|
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
commit = project.commit(commit_sha)
|
|
|
|
|
|
|
|
return unless commit
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
# This calculates and caches the signature in the database
|
2018-03-17 18:26:18 +05:30
|
|
|
Gitlab::Gpg::Commit.new(commit).signature
|
2017-09-10 17:25:29 +05:30
|
|
|
end
|
|
|
|
end
|