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
36eb9196
Commit
36eb9196
authored
Mar 22, 2024
by
duanjinfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
report model info and handler output is nil
parent
040065d7
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
1 deletion
+13
-1
model_handler.go
nm/model_handler.go
+1
-1
start.go
nm/start.go
+1
-0
task_msg.go
nm/task_msg.go
+11
-0
No files found.
nm/model_handler.go
View file @
36eb9196
...
@@ -15,7 +15,7 @@ import (
...
@@ -15,7 +15,7 @@ import (
func
monitorModelInfo
(
dockerOp
*
operate
.
DockerOp
)
{
func
monitorModelInfo
(
dockerOp
*
operate
.
DockerOp
)
{
client
:=
&
http
.
Client
{}
client
:=
&
http
.
Client
{}
ticker
:=
time
.
NewTicker
(
time
.
Second
*
1
)
ticker
:=
time
.
NewTicker
(
time
.
Second
*
1
0
)
for
{
for
{
select
{
select
{
case
<-
ticker
.
C
:
case
<-
ticker
.
C
:
...
...
nm/start.go
View file @
36eb9196
...
@@ -182,6 +182,7 @@ func monitorWorker(op *operate.DockerOp) {
...
@@ -182,6 +182,7 @@ func monitorWorker(op *operate.DockerOp) {
msgRespWorker
.
RegisterMsgResp
(
nodeManager
,
worker
,
RegisterInfoResp
,
nil
)
msgRespWorker
.
RegisterMsgResp
(
nodeManager
,
worker
,
RegisterInfoResp
,
nil
)
time
.
Sleep
(
time
.
Second
*
2
)
time
.
Sleep
(
time
.
Second
*
2
)
msgRespWorker
.
RegisterMsgResp
(
nodeManager
,
worker
,
DeviceInfoResp
,
nil
)
msgRespWorker
.
RegisterMsgResp
(
nodeManager
,
worker
,
DeviceInfoResp
,
nil
)
op
.
ModelTaskIdIndexesChan
<-
op
.
ReportTaskIds
isSend
=
true
isSend
=
true
log
.
Info
(
"------------------------Send once-off message ended------------------------"
)
log
.
Info
(
"------------------------Send once-off message ended------------------------"
)
}
}
...
...
nm/task_msg.go
View file @
36eb9196
...
@@ -374,6 +374,13 @@ func (t *TaskHandler) ComputeTaskHandler(taskMsg *nodeManagerV1.PushTaskMessage)
...
@@ -374,6 +374,13 @@ func (t *TaskHandler) ComputeTaskHandler(taskMsg *nodeManagerV1.PushTaskMessage)
apiResBody
:=
utils
.
EncodeJsonEscapeHTML
(
apiRes
)
apiResBody
:=
utils
.
EncodeJsonEscapeHTML
(
apiRes
)
taskExecResult
.
TaskRespBody
=
apiResBody
taskExecResult
.
TaskRespBody
=
apiResBody
}
}
}
else
{
taskExecResult
.
TaskExecError
=
fmt
.
Sprintf
(
"worker:%s,%s"
,
conf
.
GetConfig
()
.
SignPublicAddress
.
Hex
(),
"Container resp ouput is nil"
)
t
.
ExecTaskIdIsSuccess
.
Store
(
taskMsg
.
TaskId
,
true
)
apiRes
:=
make
([]
string
,
0
)
apiResBody
:=
utils
.
EncodeJsonEscapeHTML
(
apiRes
)
taskExecResult
.
TaskRespBody
=
apiResBody
return
}
}
}
}
}
}
...
@@ -652,6 +659,10 @@ func parseData(readBody []byte) interface{} {
...
@@ -652,6 +659,10 @@ func parseData(readBody []byte) interface{} {
log
.
WithError
(
err
)
.
Error
(
"Parse json raw message failed"
)
log
.
WithError
(
err
)
.
Error
(
"Parse json raw message failed"
)
return
bytes
.
NewBuffer
(
readBody
)
.
String
()
return
bytes
.
NewBuffer
(
readBody
)
.
String
()
}
}
if
m
[
"output"
]
==
nil
{
log
.
WithField
(
"output"
,
nil
)
.
Warn
(
"The container resp"
)
return
nil
}
var
outputTwoArray
[][]
string
var
outputTwoArray
[][]
string
if
err
:=
json
.
Unmarshal
(
m
[
"output"
],
&
outputTwoArray
);
err
!=
nil
{
if
err
:=
json
.
Unmarshal
(
m
[
"output"
],
&
outputTwoArray
);
err
!=
nil
{
log
.
WithField
(
"err"
,
err
)
.
Warn
(
"parse two array output filed failed:"
)
log
.
WithField
(
"err"
,
err
)
.
Warn
(
"parse two array output filed failed:"
)
...
...
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