Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ log_level: warn
# env: CT_TIMEOUT
timeout: 10s

# HTTP request idle timeout
# env: CT_IDLE_TIMEOUT
idle_timeout: 60s

# Timeout to wait on shutdown to allow load balancers detect that we're going away.
# During this period after the shutdown command the /alive endpoint will reply with HTTP 503.
# Set to 0s to disable.
Expand Down
5 changes: 5 additions & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ type config struct {

LogLevel string `yaml:"log_level" env:"CT_LOG_LEVEL"`
Timeout time.Duration `env:"CT_TIMEOUT"`
IdleTimeout time.Duration `yaml:"idle_timeout" env:"CT_IDLE_TIMEOUT"`
TimeoutShutdown time.Duration `yaml:"timeout_shutdown" env:"CT_TIMEOUT_SHUTDOWN"`
Concurrency int `env:"CT_CONCURRENCY"`
Metadata bool `env:"CT_METADATA"`
Expand Down Expand Up @@ -89,6 +90,10 @@ func configLoad(file string) (*config, error) {
cfg.Timeout = 10 * time.Second
}

if cfg.IdleTimeout == 0 {
cfg.IdleTimeout = 60 * time.Second
}

if cfg.Concurrency == 0 {
cfg.Concurrency = 512
}
Expand Down
6 changes: 6 additions & 0 deletions deploy/k8s/chart/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,12 @@
"description": "HTTP request timeout",
"format": "duration"
},
"idle_timeout": {
"type": "string",
"title": "Idle_Timeout",
"description": "HTTP request idle timeout",
"format": "duration"
},
"timeout_shutdown": {
"type": "string",
"title": "Shutdown timeout",
Expand Down
3 changes: 3 additions & 0 deletions deploy/k8s/chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ config:
# -- HTTP request timeout
# (env: `CT_TIMEOUT`)
timeout: 10s
# -- HTTP request idle timeout
# (env: `CT_IDLE_TIMEOUT`)
idle_timeout: 60s
# -- Timeout to wait on shutdown to allow load balancers detect that we're going away.
# During this period after the shutdown command the /alive endpoint will reply with HTTP 503.
# Set to 0s to disable.
Expand Down
2 changes: 2 additions & 0 deletions deploy/k8s/manifests/config-file-configmap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ data:
log_level: warn
# HTTP request timeout
timeout: 10s
# HTTP request idle timeout
idle_timeout: 60s
# Timeout to wait on shutdown to allow load balancers detect that we're going away.
# During this period after the shutdown command the /alive endpoint will reply with HTTP 503.
# Set to 0s to disable.
Expand Down
2 changes: 1 addition & 1 deletion processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func newProcessor(c config) *processor {

ReadTimeout: c.Timeout,
WriteTimeout: c.Timeout,
IdleTimeout: 60 * time.Second,
IdleTimeout: c.IdleTimeout,

Concurrency: c.Concurrency,
}
Expand Down