Skip to content

Commit

Permalink
feat: add TTL for server possibility (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
jlehtimaki authored Jun 18, 2024
1 parent 7070663 commit 6e348b9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cmd/warden-exporter/warden-exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (

const (
defaultPort = 8081
timeout = 10
)

func main() {
Expand Down Expand Up @@ -75,8 +74,8 @@ func main() {
srv := &http.Server{
Addr: addr,
Handler: mux,
ReadTimeout: timeout * time.Second,
WriteTimeout: timeout * time.Second,
ReadTimeout: time.Duration(cfg.TTL) * time.Second,
WriteTimeout: time.Duration(cfg.TTL) * time.Second,
}

log.Info(fmt.Sprintf("Starting server on addr: %s", addr))
Expand Down
1 change: 1 addition & 0 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type Config struct {
Addr string `env:"GRPC_ADDR" envDefault:"grpc.buenavista.wardenprotocol.org:443"`
TLS bool `env:"GRPC_TLS_ENABLED" envDefault:"true"`
Timeout int `env:"GRPC_TIMEOUT_SECONDS" envDefault:"15"`
TTL int `env:"TTL" envDefault:"30"`
ChainID string `env:"CHAIN_ID" envDefault:"buenavista-1"`
WardenMetrics bool `env:"WARDEN_METRICS" envDefault:"true"`
ValidatorMetrics bool `env:"VALIDATOR_METRICS" envDefault:"true"`
Expand Down

0 comments on commit 6e348b9

Please sign in to comment.