2018-06-27 07:31:41 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-05-04 08:02:08 +00:00
|
|
|
module Ci
|
2020-09-07 12:08:27 +00:00
|
|
|
class BuildTraceChunkFlushWorker
|
2018-05-04 08:02:08 +00:00
|
|
|
include ApplicationWorker
|
2021-04-30 18:10:09 +00:00
|
|
|
|
|
|
|
sidekiq_options retry: 3
|
2018-05-04 12:48:10 +00:00
|
|
|
include PipelineBackgroundQueue
|
2018-05-04 08:02:08 +00:00
|
|
|
|
2020-10-26 18:08:27 +00:00
|
|
|
deduplicate :until_executed
|
|
|
|
|
2020-09-07 12:08:27 +00:00
|
|
|
idempotent!
|
|
|
|
|
2018-08-27 15:31:01 +00:00
|
|
|
# rubocop: disable CodeReuse/ActiveRecord
|
2020-10-07 18:08:34 +00:00
|
|
|
def perform(id)
|
|
|
|
::Ci::BuildTraceChunk.find_by(id: id).try do |chunk|
|
|
|
|
chunk.persist_data!
|
|
|
|
end
|
2018-05-04 08:02:08 +00:00
|
|
|
end
|
2018-08-27 15:31:01 +00:00
|
|
|
# rubocop: enable CodeReuse/ActiveRecord
|
2018-05-04 08:02:08 +00:00
|
|
|
end
|
|
|
|
end
|