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
87b8d1a1
Commit
87b8d1a1
authored
Dec 04, 2017
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a NoMethodError in Geo::MetricsUpdateService
parent
fd1ef1ad
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
7 deletions
+22
-7
app/services/geo/metrics_update_service.rb
app/services/geo/metrics_update_service.rb
+1
-1
changelogs/unreleased-ee/fix-nil-method-error-metrics-update-service.yml
...leased-ee/fix-nil-method-error-metrics-update-service.yml
+5
-0
spec/services/geo/metrics_update_service_spec.rb
spec/services/geo/metrics_update_service_spec.rb
+16
-6
No files found.
app/services/geo/metrics_update_service.rb
View file @
87b8d1a1
...
...
@@ -23,7 +23,7 @@ module Geo
end
def
fetch_geo_node_metrics
(
node
)
return
unless
node
.
enabled?
return
unless
node
&
.
enabled?
return
unless
Gitlab
::
Geo
.
primary?
||
Gitlab
::
Metrics
.
prometheus_metrics_enabled?
status
=
node_status
(
node
)
...
...
changelogs/unreleased-ee/fix-nil-method-error-metrics-update-service.yml
0 → 100644
View file @
87b8d1a1
---
title
:
Fix a bug in the Geo metrics update service
merge_request
:
3623
author
:
type
:
fixed
spec/services/geo/metrics_update_service_spec.rb
View file @
87b8d1a1
...
...
@@ -3,6 +3,10 @@ require 'spec_helper'
describe
Geo
::
MetricsUpdateService
,
:geo
do
include
::
EE
::
GeoHelpers
set
(
:primary
)
{
create
(
:geo_node
,
:primary
)
}
set
(
:secondary
)
{
create
(
:geo_node
)
}
set
(
:another_secondary
)
{
create
(
:geo_node
)
}
subject
{
described_class
.
new
}
let
(
:event_date
)
{
Time
.
now
.
utc
}
...
...
@@ -38,11 +42,19 @@ describe Geo::MetricsUpdateService, :geo do
allow
(
Geo
::
NodeStatusFetchService
).
to
receive
(
:get
).
and_return
(
request
)
end
context
'when node is the primary'
do
set
(
:primary
)
{
create
(
:geo_node
,
:primary
)
}
set
(
:secondary
)
{
create
(
:geo_node
)
}
set
(
:another_secondary
)
{
create
(
:geo_node
)
}
context
'when current node is nil'
do
before
do
stub_current_geo_node
(
nil
)
end
it
'skips fetching the status'
do
expect
(
Geo
::
NodeStatusFetchService
).
to
receive
(
:get
).
never
subject
.
execute
end
end
context
'when node is the primary'
do
before
do
stub_current_geo_node
(
primary
)
end
...
...
@@ -75,8 +87,6 @@ describe Geo::MetricsUpdateService, :geo do
end
context
'when node is a secondary'
do
set
(
:secondary
)
{
create
(
:geo_node
)
}
subject
{
described_class
.
new
}
before
do
...
...
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