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
41672510
Commit
41672510
authored
Feb 02, 2024
by
duanjinfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add model info handler
parent
a7f300a9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
config.json
config.json
+3
-3
model_handler.go
nm/model_handler.go
+8
-0
No files found.
config.json
View file @
41672510
{
{
"nm_seed"
:
"192.168.1.
241
:10001"
,
"nm_seed"
:
"192.168.1.
109
:10001"
,
"docker_server"
:
"tcp://127.0.0.1:2375"
,
"docker_server"
:
"tcp://127.0.0.1:2375"
,
"api_url"
:
"http://192.168.1.
8
:8087/api/task/taskheat"
,
"api_url"
:
"http://192.168.1.
109
:8087/api/task/taskheat"
,
"node_manager_num"
:
1
,
"node_manager_num"
:
1
,
"heart_response"
:
30
,
"heart_response"
:
30
,
"task_validator_time"
:
1
,
"task_validator_time"
:
1
,
"container_num"
:
1
,
"container_num"
:
1
,
"chain_id"
:
100
,
"chain_id"
:
100
,
"validator_url"
:
"192.168.1.
211:943
1"
"validator_url"
:
"192.168.1.
109:2001
1"
}
}
\ No newline at end of file
nm/model_handler.go
View file @
41672510
...
@@ -32,6 +32,14 @@ func monitorModelInfo(dockerOp *operate.DockerOp) {
...
@@ -32,6 +32,14 @@ func monitorModelInfo(dockerOp *operate.DockerOp) {
continue
continue
}
}
resp
:=
&
models
.
Resp
{}
resp
:=
&
models
.
Resp
{}
if
resp
.
Code
!=
http
.
StatusOK
{
log
.
Error
(
"Response code :"
,
resp
.
Code
)
continue
}
if
resp
.
Data
==
""
{
log
.
Warn
(
"Response data is empty"
)
continue
}
err
=
json
.
Unmarshal
(
bodyBytes
,
resp
)
err
=
json
.
Unmarshal
(
bodyBytes
,
resp
)
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Error
(
"Unmarshal model response failed:"
,
err
)
log
.
Error
(
"Unmarshal model response failed:"
,
err
)
...
...
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