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
45e09f21
Commit
45e09f21
authored
Aug 24, 2017
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify health check and spec
parent
248e6e3c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
6 deletions
+2
-6
lib/gitlab/geo/health_check.rb
lib/gitlab/geo/health_check.rb
+0
-4
spec/lib/gitlab/geo/health_check_spec.rb
spec/lib/gitlab/geo/health_check_spec.rb
+2
-2
No files found.
lib/gitlab/geo/health_check.rb
View file @
45e09f21
...
...
@@ -55,8 +55,6 @@ module Gitlab
end
def
self
.
database_secondary?
raise
NotImplementedError
unless
Gitlab
::
Database
.
postgresql?
ActiveRecord
::
Base
.
connection
.
execute
(
'SELECT pg_is_in_recovery()'
)
.
first
.
fetch
(
'pg_is_in_recovery'
)
==
't'
...
...
@@ -64,8 +62,6 @@ module Gitlab
def
self
.
db_replication_lag
# Obtain the replication lag in seconds
raise
NotImplementedError
unless
Gitlab
::
Database
.
postgresql?
ActiveRecord
::
Base
.
connection
.
execute
(
'
SELECT CASE
WHEN pg_last_xlog_receive_location() = pg_last_xlog_replay_location()
...
...
spec/lib/gitlab/geo/health_check_spec.rb
View file @
45e09f21
...
...
@@ -30,7 +30,7 @@ describe Gitlab::Geo::HealthCheck, :postgresql do
allow
(
Gitlab
::
Geo
).
to
receive
(
:secondary?
)
{
true
}
allow
(
Gitlab
::
Geo
).
to
receive
(
:configured?
)
{
true
}
allow
(
Gitlab
::
Database
).
to
receive
(
:postgresql?
)
{
true
}
allow
(
ActiveRecord
::
Base
).
to
receive_message_chain
(
:connection
,
:execute
,
:first
,
:fetch
)
{
'f'
}
allow
(
described_class
).
to
receive
(
:database_secondary?
)
{
false
}
expect
(
subject
.
perform_checks
).
not_to
be_blank
end
...
...
@@ -39,7 +39,7 @@ describe Gitlab::Geo::HealthCheck, :postgresql do
allow
(
Gitlab
::
Geo
).
to
receive
(
:secondary?
)
{
true
}
allow
(
Gitlab
::
Geo
).
to
receive
(
:configured?
)
{
true
}
allow
(
Gitlab
::
Database
).
to
receive
(
:postgresql?
)
{
true
}
allow
(
ActiveRecord
::
Base
).
to
receive_message_chain
(
:connection
,
:execute
,
:first
,
:fetch
)
{
'f'
}
allow
(
described_class
).
to
receive
(
:database_secondary?
)
{
false
}
expect
(
subject
.
perform_checks
).
to
include
(
'not configured for streaming replication'
)
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