Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REST Client: Configurable R/W Timetout #4263

Closed
2 of 4 tasks
alexanderbez opened this issue May 3, 2019 · 0 comments · Fixed by #4285
Closed
2 of 4 tasks

REST Client: Configurable R/W Timetout #4263

alexanderbez opened this issue May 3, 2019 · 0 comments · Fixed by #4285
Assignees
Milestone

Comments

@alexanderbez
Copy link
Contributor

alexanderbez commented May 3, 2019

Summary

The REST client should take a configurable read and write timeout value (in seconds) from the CLI (e.g. rest-server --read-timeout=20 --write-timeout=20).

Those two values should then be set on the RPC server cfg:

// Start starts the rest server
func (rs *RestServer) Start(listenAddr string, maxOpen int) (err error) {
server.TrapSignal(func() {
err := rs.listener.Close()
rs.log.Error("error closing listener", "err", err)
})
cfg := rpcserver.DefaultConfig()
cfg.MaxOpenConnections = maxOpen
rs.listener, err = rpcserver.Listen(listenAddr, cfg)
if err != nil {
return
}
rs.log.Info(
fmt.Sprintf(
"Starting Gaia Lite REST service (chain-id: %q)...",
viper.GetString(client.FlagChainID),
),
)
return rpcserver.StartHTTPServer(rs.listener, rs.Mux, rs.log, cfg)
}


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant