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
4956eed2
Commit
4956eed2
authored
Jun 13, 2024
by
duanjinfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
del sign
parent
8b77bc41
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
11 deletions
+12
-11
msg_handler.go
nm/msg_handler.go
+11
-10
task_handler.go
nm/task_handler.go
+1
-1
No files found.
nm/msg_handler.go
View file @
4956eed2
...
...
@@ -80,24 +80,25 @@ func (n *NodeManagerHandler) DistributionMsgWorker(nodeManagerMsgChan chan *node
}
isSuccess
:=
taskExecRes
.
TaskIsSuccess
containerSign
:=
make
([]
byte
,
0
)
minerSign
:=
make
([]
byte
,
0
)
if
taskExecRes
.
TaskRespBody
!=
nil
{
containerSign
=
taskMsgWorker
.
DockerOp
.
GetContainerSign
(
taskMsg
,
taskExecRes
.
TaskRespBody
)
if
containerSign
==
nil
||
len
(
containerSign
)
==
0
{
log
.
Error
(
"Container signing failed................"
)
isSuccess
=
false
taskExecRes
.
TaskExecError
=
fmt
.
Sprintf
(
"%s-%s"
,
"Container sign failed"
,
taskExecRes
.
TaskExecError
)
}
//
containerSign = taskMsgWorker.DockerOp.GetContainerSign(taskMsg, taskExecRes.TaskRespBody)
//
if containerSign == nil || len(containerSign) == 0 {
//
log.Error("Container signing failed................")
//
isSuccess = false
//
taskExecRes.TaskExecError = fmt.Sprintf("%s-%s", "Container sign failed", taskExecRes.TaskExecError)
//
}
}
else
{
isSuccess
=
false
taskExecRes
.
TaskExecError
=
fmt
.
Sprintf
(
"worker:%s-%s-%s"
,
conf
.
GetConfig
()
.
SignPublicAddress
.
Hex
(),
"Task exec error"
,
taskExecRes
.
TaskExecError
)
}
reqHash
,
respHash
,
minerSign
:=
taskMsgWorker
.
GetMinerSign
(
taskMsg
,
taskExecRes
.
TaskRespBody
)
//
reqHash, respHash, minerSign := taskMsgWorker.GetMinerSign(taskMsg, taskExecRes.TaskRespBody)
taskResultParams
:=
utils
.
BuildParams
(
taskMsg
.
TaskId
,
containerSign
,
minerSign
,
taskExecRes
,
isSuccess
)
taskMsgWorker
.
LruCache
.
Add
(
taskMsg
.
TaskId
+
models
.
TaskType
,
taskMsg
.
TaskType
)
taskMsgWorker
.
LruCache
.
Add
(
taskMsg
.
TaskId
+
models
.
ContainerSign
,
containerSign
)
taskMsgWorker
.
LruCache
.
Add
(
taskMsg
.
TaskId
+
models
.
MinerSign
,
minerSign
)
taskMsgWorker
.
LruCache
.
Add
(
taskMsg
.
TaskId
+
models
.
ReqHash
,
reqHash
)
taskMsgWorker
.
LruCache
.
Add
(
taskMsg
.
TaskId
+
models
.
RespHash
,
respHash
)
//
taskMsgWorker.LruCache.Add(taskMsg.TaskId+models.MinerSign, minerSign)
//
taskMsgWorker.LruCache.Add(taskMsg.TaskId+models.ReqHash, reqHash)
//
taskMsgWorker.LruCache.Add(taskMsg.TaskId+models.RespHash, respHash)
msgRespWorker
.
RegisterMsgResp
(
n
.
nodeManager
,
n
.
worker
,
SubmitResultResp
,
taskResultParams
)
RunningState
.
CompletedTaskCount
++
log
.
Info
(
"Completed task count: "
,
RunningState
.
CompletedTaskCount
)
...
...
nm/task_handler.go
View file @
4956eed2
...
...
@@ -182,7 +182,7 @@ func (t *TaskWorker) ComputeTaskHandler(taskMsg *nodemanagerV2.PushTaskMessage)
t
.
ExecTaskIdIsFinished
.
Store
(
taskMsg
.
TaskId
,
true
)
return
}
time
.
Sleep
(
time
.
Millisecond
*
100
)
//
time.Sleep(time.Millisecond * 100)
//running, _ := t.foundImageIsRunning(taskOp.taskCmd.ImageName)
//if !running {
// taskOp.taskCmd.DockerCmd.HostIp = models.ZeroHost
...
...
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