2021-02-22 17:27:13 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Releases
|
|
|
|
class ManageEvidenceWorker # rubocop:disable Scalability/IdempotentWorker
|
|
|
|
include ApplicationWorker
|
2021-06-08 01:23:25 +05:30
|
|
|
|
|
|
|
sidekiq_options retry: 3
|
2021-02-22 17:27:13 +05:30
|
|
|
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext
|
|
|
|
|
|
|
|
feature_category :release_evidence
|
2021-06-08 01:23:25 +05:30
|
|
|
tags :exclude_from_kubernetes
|
2021-02-22 17:27:13 +05:30
|
|
|
|
|
|
|
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
|