Commit 9259bfd4 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Merge branch 'jv-trace-chunks-flag-scope' into 'master'

Allow toggling dedicated_redis_trace_chunks per project

See merge request gitlab-org/gitlab!63865
parents be65e708 82f55a42
......@@ -14,8 +14,14 @@ module Ci
belongs_to :build, class_name: "Ci::Build", foreign_key: :build_id
default_value_for :data_store do
if Feature.enabled?(:dedicated_redis_trace_chunks, type: :ops)
default_value_for :data_store do |chunk|
# We're using the safe operator here to get to the project for which we're
# creating a TraceChunk because the build attribute would not be populated
# when the chunk was initialized by FactoryBot:
# https://github.com/thoughtbot/factory_bot/wiki/How-factory_bot-interacts-with-ActiveRecord
# While the `default_value_for` gem depends on an `after_initialize`
# callback.
if Feature.enabled?(:dedicated_redis_trace_chunks, chunk.build&.project, type: :ops)
:redis_trace_chunks
else
:redis
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment