Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
b24fb76a
Unverified
Commit
b24fb76a
authored
Aug 16, 2018
by
Péter Szilágyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/puppeth: fix nil panic on disconnected stats gathering
parent
2cdf6ee7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
wizard_netstats.go
cmd/puppeth/wizard_netstats.go
+10
-2
No files found.
cmd/puppeth/wizard_netstats.go
View file @
b24fb76a
...
@@ -82,7 +82,6 @@ func (w *wizard) gatherStats(server string, pubkey []byte, client *sshClient) *s
...
@@ -82,7 +82,6 @@ func (w *wizard) gatherStats(server string, pubkey []byte, client *sshClient) *s
logger
.
Info
(
"Starting remote server health-check"
)
logger
.
Info
(
"Starting remote server health-check"
)
stat
:=
&
serverStat
{
stat
:=
&
serverStat
{
address
:
client
.
address
,
services
:
make
(
map
[
string
]
map
[
string
]
string
),
services
:
make
(
map
[
string
]
map
[
string
]
string
),
}
}
if
client
==
nil
{
if
client
==
nil
{
...
@@ -94,6 +93,8 @@ func (w *wizard) gatherStats(server string, pubkey []byte, client *sshClient) *s
...
@@ -94,6 +93,8 @@ func (w *wizard) gatherStats(server string, pubkey []byte, client *sshClient) *s
}
}
client
=
conn
client
=
conn
}
}
stat
.
address
=
client
.
address
// Client connected one way or another, run health-checks
// Client connected one way or another, run health-checks
logger
.
Debug
(
"Checking for nginx availability"
)
logger
.
Debug
(
"Checking for nginx availability"
)
if
infos
,
err
:=
checkNginx
(
client
,
w
.
network
);
err
!=
nil
{
if
infos
,
err
:=
checkNginx
(
client
,
w
.
network
);
err
!=
nil
{
...
@@ -214,6 +215,9 @@ func (stats serverStats) render() {
...
@@ -214,6 +215,9 @@ func (stats serverStats) render() {
if
len
(
stat
.
address
)
>
len
(
separator
[
1
])
{
if
len
(
stat
.
address
)
>
len
(
separator
[
1
])
{
separator
[
1
]
=
strings
.
Repeat
(
"-"
,
len
(
stat
.
address
))
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
{
for
service
,
configs
:=
range
stat
.
services
{
if
len
(
service
)
>
len
(
separator
[
2
])
{
if
len
(
service
)
>
len
(
separator
[
2
])
{
separator
[
2
]
=
strings
.
Repeat
(
"-"
,
len
(
service
))
separator
[
2
]
=
strings
.
Repeat
(
"-"
,
len
(
service
))
...
@@ -250,7 +254,11 @@ func (stats serverStats) render() {
...
@@ -250,7 +254,11 @@ func (stats serverStats) render() {
sort
.
Strings
(
services
)
sort
.
Strings
(
services
)
if
len
(
services
)
==
0
{
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
{
for
j
,
service
:=
range
services
{
// Add an empty line between all services
// Add an empty line between all services
...
...
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