Skip to content

Commit

Permalink
PA-26431 Fix Insrequester Timeout Data Type
Browse files Browse the repository at this point in the history
  • Loading branch information
rafet committed Apr 25, 2024
1 parent 6c5fad5 commit 307d596
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions insrequester/requester.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ type RequestEntity struct {
}

type Request struct {
timeout int
timeout time.Duration
runner goresilience.Runner
middlewares []goresilience.Middleware
headers Headers
Expand Down Expand Up @@ -189,13 +189,13 @@ func (r *Request) WithCircuitbreaker(config CircuitBreakerConfig) *Request {

func (r *Request) WithTimeout(timeoutSeconds int) *Request {
if timeoutSeconds == 0 {
r.timeout = 30
r.timeout = 30 * time.Second
} else {
r.timeout = timeoutSeconds
r.timeout = time.Duration(timeoutSeconds) * time.Second
}

mw := timeout.NewMiddleware(timeout.Config{
Timeout: time.Duration(r.timeout) * time.Second,
Timeout: r.timeout,
})
r.middlewares = append(r.middlewares, mw)

Expand Down

0 comments on commit 307d596

Please sign in to comment.