good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
bor
Commits
b24fb76a
Unverified
Commit
b24fb76a
authored
6 years ago
by
Péter Szilágyi
Browse files
Options
Downloads
Patches
Plain Diff
cmd/puppeth: fix nil panic on disconnected stats gathering
parent
2cdf6ee7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cmd/puppeth/wizard_netstats.go
+10
-2
10 additions, 2 deletions
cmd/puppeth/wizard_netstats.go
with
10 additions
and
2 deletions
cmd/puppeth/wizard_netstats.go
+
10
−
2
View file @
b24fb76a
...
...
@@ -82,7 +82,6 @@ func (w *wizard) gatherStats(server string, pubkey []byte, client *sshClient) *s
logger
.
Info
(
"Starting remote server health-check"
)
stat
:=
&
serverStat
{
address
:
client
.
address
,
services
:
make
(
map
[
string
]
map
[
string
]
string
),
}
if
client
==
nil
{
...
...
@@ -94,6 +93,8 @@ func (w *wizard) gatherStats(server string, pubkey []byte, client *sshClient) *s
}
client
=
conn
}
stat
.
address
=
client
.
address
// Client connected one way or another, run health-checks
logger
.
Debug
(
"Checking for nginx availability"
)
if
infos
,
err
:=
checkNginx
(
client
,
w
.
network
);
err
!=
nil
{
...
...
@@ -214,6 +215,9 @@ func (stats serverStats) render() {
if
len
(
stat
.
address
)
>
len
(
separator
[
1
])
{
separator
[
1
]
=
strings
.
Repeat
(
"-"
,
len
(
stat
.
address
))
}
if
len
(
stat
.
failure
)
>
len
(
separator
[
1
])
{
separator
[
1
]
=
strings
.
Repeat
(
"-"
,
len
(
stat
.
failure
))
}
for
service
,
configs
:=
range
stat
.
services
{
if
len
(
service
)
>
len
(
separator
[
2
])
{
separator
[
2
]
=
strings
.
Repeat
(
"-"
,
len
(
service
))
...
...
@@ -250,7 +254,11 @@ func (stats serverStats) render() {
sort
.
Strings
(
services
)
if
len
(
services
)
==
0
{
table
.
Append
([]
string
{
server
,
stats
[
server
]
.
address
,
""
,
""
,
""
})
if
stats
[
server
]
.
failure
!=
""
{
table
.
Append
([]
string
{
server
,
stats
[
server
]
.
failure
,
""
,
""
,
""
})
}
else
{
table
.
Append
([]
string
{
server
,
stats
[
server
]
.
address
,
""
,
""
,
""
})
}
}
for
j
,
service
:=
range
services
{
// Add an empty line between all services
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment