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
4749cc22
Commit
4749cc22
authored
Dec 21, 2021
by
Aleksei Lipniagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid DB calls for empty DB check in Multistore
parent
c3bab430
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
lib/gitlab/redis/multi_store.rb
lib/gitlab/redis/multi_store.rb
+9
-2
No files found.
lib/gitlab/redis/multi_store.rb
View file @
4749cc22
...
...
@@ -97,15 +97,22 @@ module Gitlab
end
def
use_primary_and_secondary_stores?
Feature
.
enabled?
(
"use_primary_and_secondary_stores_for_
#{
instance_name
.
underscore
}
"
,
default_enabled: :yaml
)
&&
!
same_redis_store?
feature_table_exists?
&&
Feature
.
enabled?
(
"use_primary_and_secondary_stores_for_
#{
instance_name
.
underscore
}
"
,
default_enabled: :yaml
)
&&
!
same_redis_store?
end
def
use_primary_store_as_default?
Feature
.
enabled?
(
"use_primary_store_as_default_for_
#{
instance_name
.
underscore
}
"
,
default_enabled: :yaml
)
&&
!
same_redis_store?
feature_table_exists?
&&
Feature
.
enabled?
(
"use_primary_store_as_default_for_
#{
instance_name
.
underscore
}
"
,
default_enabled: :yaml
)
&&
!
same_redis_store?
end
private
# @return [Boolean]
def
feature_table_exists?
Feature
::
FlipperFeature
.
table_exists?
rescue
StandardError
false
end
def
default_store
use_primary_store_as_default?
?
primary_store
:
secondary_store
end
...
...
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