Skip to content

Commit

Permalink
Merge pull request #869 from zhdkirill/maxTimeoutSeconds
Browse files Browse the repository at this point in the history
Negative maxTimeoutSeconds
  • Loading branch information
electron0zero authored May 6, 2022
2 parents ee1ec56 + fb6d817 commit 114351f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ func getTimeout(r *http.Request, module config.Module, offset float64) (timeoutS
}

var maxTimeoutSeconds = timeoutSeconds - offset
if module.Timeout.Seconds() < maxTimeoutSeconds && module.Timeout.Seconds() > 0 {
if module.Timeout.Seconds() < maxTimeoutSeconds && module.Timeout.Seconds() > 0 || maxTimeoutSeconds < 0 {
timeoutSeconds = module.Timeout.Seconds()
} else {
timeoutSeconds = maxTimeoutSeconds
Expand Down

0 comments on commit 114351f

Please sign in to comment.