2018-11-08 19:23:39 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-10-15 14:42:47 +05:30
|
|
|
module Ci
|
2020-11-24 15:15:51 +05:30
|
|
|
class BuildTraceChunkFlushWorker
|
2018-10-15 14:42:47 +05:30
|
|
|
include ApplicationWorker
|
|
|
|
include PipelineBackgroundQueue
|
|
|
|
|
2020-11-24 15:15:51 +05:30
|
|
|
idempotent!
|
|
|
|
|
2018-12-05 23:21:45 +05:30
|
|
|
# rubocop: disable CodeReuse/ActiveRecord
|
2020-11-24 15:15:51 +05:30
|
|
|
def perform(chunk_id)
|
|
|
|
::Ci::BuildTraceChunk.find_by(id: chunk_id).try do |chunk|
|
|
|
|
chunk.persist_data!
|
2018-10-15 14:42:47 +05:30
|
|
|
end
|
|
|
|
end
|
2018-12-05 23:21:45 +05:30
|
|
|
# rubocop: enable CodeReuse/ActiveRecord
|
2018-10-15 14:42:47 +05:30
|
|
|
end
|
|
|
|
end
|