Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
82f55a42
Commit
82f55a42
authored
Jun 11, 2021
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow toggling dedicated_redis_trace_chunks per project
parent
8baad3c7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
app/models/ci/build_trace_chunk.rb
app/models/ci/build_trace_chunk.rb
+8
-2
No files found.
app/models/ci/build_trace_chunk.rb
View file @
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment