MCPcopy Create free account
hub / github.com/InferCore/InferCore / validateServerHTTPTimeouts

Method validateServerHTTPTimeouts

internal/config/config.go:264–281  ·  view source on GitHub ↗

24h

()

Source from the content-addressed store, hash-verified

262const maxHTTPTimeoutMS = 86400000 // 24h
263
264func (c *Config) validateServerHTTPTimeouts() error {
265 check := func(field string, ms int) error {
266 if ms < 0 {
267 return fmt.Errorf("config validation: %s cannot be negative", field)
268 }
269 if ms > maxHTTPTimeoutMS {
270 return fmt.Errorf("config validation: %s exceeds 24h", field)
271 }
272 return nil
273 }
274 if err := check("server.http.read_timeout_ms", c.Server.HTTP.ReadTimeoutMS); err != nil {
275 return err
276 }
277 if err := check("server.http.write_timeout_ms", c.Server.HTTP.WriteTimeoutMS); err != nil {
278 return err
279 }
280 return check("server.http.idle_timeout_ms", c.Server.HTTP.IdleTimeoutMS)
281}
282
283func (c *Config) validate() error {
284 if err := c.validateServerHTTPTimeouts(); err != nil {

Callers 1

validateMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected