MCPcopy Create free account
hub / github.com/ContentSquare/chproxy / setServerMaxResponseTime

Method setServerMaxResponseTime

config/config.go:213–228  ·  view source on GitHub ↗
(maxResponseTime time.Duration)

Source from the content-addressed store, hash-verified

211}
212
213func (cfg *Config) setServerMaxResponseTime(maxResponseTime time.Duration) {
214 if maxResponseTime < 0 {
215 maxResponseTime = 0
216 }
217
218 // Give an additional minute for the maximum response time,
219 // so the response body may be sent to the requester.
220 maxResponseTime += time.Minute
221 if len(cfg.Server.HTTP.ListenAddr) > 0 && cfg.Server.HTTP.WriteTimeout == 0 {
222 cfg.Server.HTTP.WriteTimeout = Duration(maxResponseTime)
223 }
224
225 if len(cfg.Server.HTTPS.ListenAddr) > 0 && cfg.Server.HTTPS.WriteTimeout == 0 {
226 cfg.Server.HTTPS.WriteTimeout = Duration(maxResponseTime)
227 }
228}
229
230func (c *Config) groupToNetwork(src NetworksOrGroups) (Networks, error) {
231 if len(src) == 0 {

Callers 1

setDefaultsMethod · 0.95

Calls 1

DurationTypeAlias · 0.85

Tested by

no test coverage detected