2020-11-18 16:09:32 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Releases
|
|
|
|
class ManageEvidenceWorker # rubocop:disable Scalability/IdempotentWorker
|
|
|
|
include ApplicationWorker
|
2021-04-30 14:10:09 -04:00
|
|
|
|
2021-07-21 08:09:35 -04:00
|
|
|
data_consistency :always
|
|
|
|
|
2020-11-18 16:09:32 -05:00
|
|
|
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext
|
|
|
|
|
|
|
|
feature_category :release_evidence
|
|
|
|
|
|
|
|
def perform
|
|
|
|
releases = Release.without_evidence.released_within_2hrs
|
|
|
|
|
|
|
|
releases.each do |release|
|
|
|
|
project = release.project
|
|
|
|
params = { tag: release.tag }
|
|
|
|
|
|
|
|
evidence_pipeline = Releases::EvidencePipelineFinder.new(project, params).execute
|
|
|
|
|
|
|
|
# perform_at released_at
|
|
|
|
::Releases::CreateEvidenceWorker.perform_async(release.id, evidence_pipeline&.id)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|