Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
power-node
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Odysseus
power-node
Commits
7f5e6478
Commit
7f5e6478
authored
Mar 12, 2024
by
duanjinfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update nm status
parent
95b3ab71
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
3 deletions
+6
-3
node_manager.go
models/node_manager.go
+1
-1
monitor_seed.go
nm/monitor_seed.go
+4
-2
start.go
nm/start.go
+1
-0
No files found.
models/node_manager.go
View file @
7f5e6478
...
...
@@ -108,6 +108,6 @@ func (n *NodeManagerClient) GetStatus() bool {
func
(
n
*
NodeManagerClient
)
UpdateStatus
(
status
bool
)
{
n
.
mutex
.
Lock
()
defer
n
.
mutex
.
Unlock
()
n
.
Status
=
status
n
.
mutex
.
Unlock
()
}
nm/monitor_seed.go
View file @
7f5e6478
...
...
@@ -21,7 +21,8 @@ func monitorNodeManagerSeed() {
seedServiceClient
:=
operate
.
ConnNmGrpc
(
seed
)
if
seedServiceClient
==
nil
{
if
connectNmCumulativeCount
==
conf
.
GetConfig
()
.
AllowConnNmCount
{
panic
(
"Dial nm seed service client failed"
)
log
.
Error
(
"Dial nm seed service client failed"
)
continue
}
log
.
Warn
(
"Connect nm seed service client is nil"
)
connectNmCumulativeCount
++
...
...
@@ -30,7 +31,8 @@ func monitorNodeManagerSeed() {
list
,
err
:=
seedServiceClient
.
ManagerList
(
context
.
Background
(),
&
nodeManagerV1
.
ManagerListRequest
{},
grpc
.
EmptyCallOption
{})
if
err
!=
nil
{
if
connectNmCumulativeCount
==
conf
.
GetConfig
()
.
AllowConnNmCount
{
panic
(
"Nm seed seed service is dealing"
)
log
.
Error
(
"Nm seed seed service is dealing"
)
continue
}
log
.
WithError
(
err
)
.
Warn
(
"Get manager list failed through nm seed service"
)
connectNmCumulativeCount
++
...
...
nm/start.go
View file @
7f5e6478
...
...
@@ -269,6 +269,7 @@ func handlerMsg(nodeManager *models.NodeManagerClient,
case
rev
:=
<-
nodeManagerMsgChan
:
{
if
!
nodeManager
.
Status
{
log
.
Warn
(
"handlerMsg -> node manager is not running"
)
return
}
heartbeatReq
:=
rev
.
GetHeartbeatRequest
()
...
...
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