Commit 685893ba authored by duanjinfei's avatar duanjinfei

update wait container start up

parent 6abe240d
...@@ -537,7 +537,7 @@ func (op *TaskOp) waitReqContainerOk(dockerOp *operate.DockerOp) error { ...@@ -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") 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") 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) post, err := op.httpClient.Do(newQuest)
if err != nil { if err != nil {
log.WithField("error:", err).Error("Http client post request container failed") log.WithField("error:", err).Error("Http client post request container failed")
......
...@@ -13,6 +13,7 @@ import ( ...@@ -13,6 +13,7 @@ import (
"github.com/ethereum/go-ethereum/accounts/keystore" "github.com/ethereum/go-ethereum/accounts/keystore"
"github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto"
"math/big" "math/big"
"net/http"
"net/url" "net/url"
"os" "os"
"strings" "strings"
...@@ -175,3 +176,26 @@ func BuildParams(params ...interface{}) []interface{} { ...@@ -175,3 +176,26 @@ func BuildParams(params ...interface{}) []interface{} {
} }
return res 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
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment