refactor: guard timeout on API files (#1726)
This commit is contained in:
@@ -119,6 +119,14 @@ func (ng *engine) bindRoutes(router httpx.Router) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (ng *engine) checkedMaxBytes(bytes int64) int64 {
|
||||
if bytes > 0 {
|
||||
return bytes
|
||||
}
|
||||
|
||||
return ng.conf.MaxBytes
|
||||
}
|
||||
|
||||
func (ng *engine) checkedTimeout(timeout time.Duration) time.Duration {
|
||||
if timeout > 0 {
|
||||
return timeout
|
||||
@@ -127,15 +135,6 @@ func (ng *engine) checkedTimeout(timeout time.Duration) time.Duration {
|
||||
return time.Duration(ng.conf.Timeout) * time.Millisecond
|
||||
}
|
||||
|
||||
func (ng *engine) checkedMaxBytes(bytes int64) int64 {
|
||||
|
||||
if bytes > 0 {
|
||||
return bytes
|
||||
}
|
||||
|
||||
return ng.conf.MaxBytes
|
||||
}
|
||||
|
||||
func (ng *engine) createMetrics() *stat.Metrics {
|
||||
var metrics *stat.Metrics
|
||||
|
||||
|
||||
Reference in New Issue
Block a user