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
165669b2
Commit
165669b2
authored
Jul 08, 2019
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wrap load_balancing initializer in `ee` block
parent
e1f3b4b6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
13 deletions
+16
-13
config/initializers/load_balancing.rb
config/initializers/load_balancing.rb
+16
-13
No files found.
config/initializers/load_balancing.rb
View file @
165669b2
# We need to run this initializer after migrations are done so it doesn't fail on CI
if
ActiveRecord
::
Base
.
connected?
&&
ActiveRecord
::
Base
.
connection
.
data_source_exists?
(
'licenses'
)
if
Gitlab
::
Database
::
LoadBalancing
.
enable?
Gitlab
::
Database
.
disable_prepared_statements
Gitlab
::
Application
.
configure
do
|
config
|
config
.
middleware
.
use
(
Gitlab
::
Database
::
LoadBalancing
::
RackMiddleware
)
end
Gitlab
.
ee
do
if
ActiveRecord
::
Base
.
connected?
&&
ActiveRecord
::
Base
.
connection
.
data_source_exists?
(
'licenses'
)
if
Gitlab
::
Database
::
LoadBalancing
.
enable?
Gitlab
::
Database
.
disable_prepared_statements
Gitlab
::
Database
::
LoadBalancing
.
configure_proxy
Gitlab
::
Application
.
configure
do
|
config
|
config
.
middleware
.
use
(
Gitlab
::
Database
::
LoadBalancing
::
RackMiddleware
)
end
# This needs to be executed after fork of clustered processes
Gitlab
::
Cluster
::
LifecycleEvents
.
on_worker_start
do
# Service discovery must be started after configuring the proxy, as service
# discovery depends on this.
Gitlab
::
Database
::
LoadBalancing
.
start_service_discovery
end
Gitlab
::
Database
::
LoadBalancing
.
configure_proxy
# This needs to be executed after fork of clustered processes
Gitlab
::
Cluster
::
LifecycleEvents
.
on_worker_start
do
# Service discovery must be started after configuring the proxy, as service
# discovery depends on this.
Gitlab
::
Database
::
LoadBalancing
.
start_service_discovery
end
end
end
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