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
ffd4d50c
Commit
ffd4d50c
authored
Feb 13, 2020
by
nmilojevic1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move logic to active_record_lifecycle
parent
d0fb0a2a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
3 deletions
+8
-3
config/initializers/active_record_lifecycle.rb
config/initializers/active_record_lifecycle.rb
+8
-0
lib/gitlab/cluster/mixins/puma_cluster.rb
lib/gitlab/cluster/mixins/puma_cluster.rb
+0
-1
lib/gitlab/cluster/mixins/unicorn_http_server.rb
lib/gitlab/cluster/mixins/unicorn_http_server.rb
+0
-2
No files found.
config/initializers/active_record_lifecycle.rb
View file @
ffd4d50c
...
@@ -12,6 +12,14 @@ if defined?(ActiveRecord::Base) && !Gitlab::Runtime.sidekiq?
...
@@ -12,6 +12,14 @@ if defined?(ActiveRecord::Base) && !Gitlab::Runtime.sidekiq?
end
end
end
end
if
defined?
(
ActiveRecord
::
Base
)
&&
Gitlab
::
Runtime
.
web_server?
Gitlab
::
Cluster
::
LifecycleEvents
.
on_before_fork
do
ActiveSupport
.
on_load
(
:active_record
)
do
raise
'ActiveRecord connection not established. Unable to start.'
unless
::
ActiveRecord
::
Base
.
connected?
end
end
end
if
defined?
(
ActiveRecord
::
Base
)
if
defined?
(
ActiveRecord
::
Base
)
Gitlab
::
Cluster
::
LifecycleEvents
.
on_before_fork
do
Gitlab
::
Cluster
::
LifecycleEvents
.
on_before_fork
do
# the following is highly recommended for Rails + "preload_app true"
# the following is highly recommended for Rails + "preload_app true"
...
...
lib/gitlab/cluster/mixins/puma_cluster.rb
View file @
ffd4d50c
...
@@ -6,7 +6,6 @@ module Gitlab
...
@@ -6,7 +6,6 @@ module Gitlab
module
PumaCluster
module
PumaCluster
def
self
.
prepended
(
base
)
def
self
.
prepended
(
base
)
raise
'missing method Puma::Cluster#stop_workers'
unless
base
.
method_defined?
(
:stop_workers
)
raise
'missing method Puma::Cluster#stop_workers'
unless
base
.
method_defined?
(
:stop_workers
)
raise
'ActiveRecord connection not established. Unable to start.'
unless
ActiveRecord
::
Base
.
connected?
end
end
# This looks at internal status of `Puma::Cluster`
# This looks at internal status of `Puma::Cluster`
...
...
lib/gitlab/cluster/mixins/unicorn_http_server.rb
View file @
ffd4d50c
...
@@ -8,8 +8,6 @@ module Gitlab
...
@@ -8,8 +8,6 @@ module Gitlab
unless
base
.
method_defined?
(
:reexec
)
&&
base
.
method_defined?
(
:stop
)
unless
base
.
method_defined?
(
:reexec
)
&&
base
.
method_defined?
(
:stop
)
raise
'missing method Unicorn::HttpServer#reexec or Unicorn::HttpServer#stop'
raise
'missing method Unicorn::HttpServer#reexec or Unicorn::HttpServer#stop'
end
end
raise
'ActiveRecord connection not established. Unable to start.'
unless
::
ActiveRecord
::
Base
.
connected?
end
end
def
reexec
def
reexec
...
...
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