Commit 82f55a42 authored by Jacob Vosmaer's avatar Jacob Vosmaer

Allow toggling dedicated_redis_trace_chunks per project

parent 8baad3c7
...@@ -14,8 +14,14 @@ module Ci ...@@ -14,8 +14,14 @@ module Ci
belongs_to :build, class_name: "Ci::Build", foreign_key: :build_id belongs_to :build, class_name: "Ci::Build", foreign_key: :build_id
default_value_for :data_store do default_value_for :data_store do |chunk|
if Feature.enabled?(:dedicated_redis_trace_chunks, type: :ops) # 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 :redis_trace_chunks
else else
:redis :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