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
8a5d323b
Commit
8a5d323b
authored
Mar 22, 2024
by
duanjinfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add wait last task exec timeout
parent
36eb9196
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
18 deletions
+27
-18
config.go
conf/config.go
+18
-17
config.json
config.json
+2
-1
task_msg.go
nm/task_msg.go
+7
-0
No files found.
conf/config.go
View file @
8a5d323b
...
@@ -9,23 +9,24 @@ import (
...
@@ -9,23 +9,24 @@ import (
)
)
type
Config
struct
{
type
Config
struct
{
SignPrv
string
SignPrv
string
SignPub
string
SignPub
string
DockerServer
string
DockerServer
string
BenefitAddress
string
BenefitAddress
string
HeartRespTimeMillis
int64
HeartRespTimeMillis
int64
ExternalIp
string
ExternalIp
string
SignPublicAddress
common
.
Address
SignPublicAddress
common
.
Address
SignPrivateKey
*
ecdsa
.
PrivateKey
SignPrivateKey
*
ecdsa
.
PrivateKey
NmSeed
string
`json:"nm_seed"`
NmSeed
string
`json:"nm_seed"`
HeartRespTimeSecond
int64
`json:"heart_response"`
HeartRespTimeSecond
int64
`json:"heart_response"`
TaskValidatorTime
float64
`json:"task_validator_time"`
TaskValidatorTime
float64
`json:"task_validator_time"`
ContainerNum
int64
`json:"container_num"`
ContainerNum
int64
`json:"container_num"`
NodeManagerNum
int64
`json:"node_manager_num"`
NodeManagerNum
int64
`json:"node_manager_num"`
ChainID
int64
`json:"chain_id"`
ChainID
int64
`json:"chain_id"`
ApiUrl
string
`json:"api_url"`
ApiUrl
string
`json:"api_url"`
ValidatorUrl
string
`json:"validator_url"`
ValidatorUrl
string
`json:"validator_url"`
OssUrl
string
`json:"oss_url"`
OssUrl
string
`json:"oss_url"`
WaitLastTaskExecTime
int64
`json:"wait_last_task_exec_time"`
}
}
var
_cfg
*
Config
=
nil
var
_cfg
*
Config
=
nil
...
...
config.json
View file @
8a5d323b
...
@@ -7,5 +7,6 @@
...
@@ -7,5 +7,6 @@
"container_num"
:
1
,
"container_num"
:
1
,
"chain_id"
:
100
,
"chain_id"
:
100
,
"validator_url"
:
"43.198.29.144:20011"
,
"validator_url"
:
"43.198.29.144:20011"
,
"oss_url"
:
"https://tmp-file.agicoin.ai/api/v1/upload"
"oss_url"
:
"https://tmp-file.agicoin.ai/api/v1/upload"
,
"wait_last_task_exec_time"
:
10
}
}
\ No newline at end of file
nm/task_msg.go
View file @
8a5d323b
...
@@ -584,7 +584,14 @@ func (t *TaskHandler) checkLastTaskExecStatus(taskMsg *nodeManagerV1.PushTaskMes
...
@@ -584,7 +584,14 @@ func (t *TaskHandler) checkLastTaskExecStatus(taskMsg *nodeManagerV1.PushTaskMes
t
.
IsExecStandardTask
=
true
t
.
IsExecStandardTask
=
true
}
}
if
oldTaskId
!=
taskMsg
.
TaskId
{
if
oldTaskId
!=
taskMsg
.
TaskId
{
now
:=
time
.
Now
()
for
{
for
{
since
:=
time
.
Since
(
now
)
if
int64
(
since
.
Seconds
())
>
conf
.
GetConfig
()
.
WaitLastTaskExecTime
{
log
.
WithField
(
"taskId"
,
oldTaskId
)
.
Info
(
"Waiting for last task execution ending"
)
oldTaskId
=
taskMsg
.
TaskId
break
}
if
oldTaskId
==
""
{
if
oldTaskId
==
""
{
oldTaskId
=
taskMsg
.
TaskId
oldTaskId
=
taskMsg
.
TaskId
break
break
...
...
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