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
685893ba
Commit
685893ba
authored
Apr 01, 2024
by
duanjinfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update wait container start up
parent
6abe240d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
1 deletion
+25
-1
task_handler.go
nm/task_handler.go
+1
-1
util.go
utils/util.go
+24
-0
No files found.
nm/task_handler.go
View file @
685893ba
...
...
@@ -537,7 +537,7 @@ func (op *TaskOp) waitReqContainerOk(dockerOp *operate.DockerOp) error {
log
.
Errorf
(
"%s"
,
"The maximum execution time for this task has been exceeded"
)
return
fmt
.
Errorf
(
"%s"
,
"The maximum execution time for this task has been exceeded"
)
}
newQuest
:=
op
.
request
newQuest
:=
utils
.
CloneRequest
(
op
.
request
)
post
,
err
:=
op
.
httpClient
.
Do
(
newQuest
)
if
err
!=
nil
{
log
.
WithField
(
"error:"
,
err
)
.
Error
(
"Http client post request container failed"
)
...
...
utils/util.go
View file @
685893ba
...
...
@@ -13,6 +13,7 @@ import (
"github.com/ethereum/go-ethereum/accounts/keystore"
"github.com/ethereum/go-ethereum/crypto"
"math/big"
"net/http"
"net/url"
"os"
"strings"
...
...
@@ -175,3 +176,26 @@ func BuildParams(params ...interface{}) []interface{} {
}
return
res
}
func
CloneRequest
(
r
*
http
.
Request
)
*
http
.
Request
{
copiedRequest
:=
&
http
.
Request
{
Method
:
r
.
Method
,
URL
:
r
.
URL
,
Proto
:
r
.
Proto
,
ProtoMajor
:
r
.
ProtoMajor
,
ProtoMinor
:
r
.
ProtoMinor
,
Header
:
make
(
http
.
Header
),
Body
:
r
.
Body
,
ContentLength
:
r
.
ContentLength
,
TransferEncoding
:
append
([]
string
(
nil
),
r
.
TransferEncoding
...
),
Close
:
r
.
Close
,
Host
:
r
.
Host
,
RemoteAddr
:
r
.
RemoteAddr
,
RequestURI
:
r
.
RequestURI
,
TLS
:
r
.
TLS
,
}
for
k
,
v
:=
range
r
.
Header
{
copiedRequest
.
Header
[
k
]
=
v
}
return
copiedRequest
}
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