Skip to content

REST Client: Configurable R/W Timetout #4263

Closed
@alexanderbez

Description

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions