Skip to content

Commit

Permalink
Add retry mechanism for all endpoints that request data from nodes an…
Browse files Browse the repository at this point in the history
…d update vulnerable dependencies
  • Loading branch information
LINCKODE committed Jan 23, 2025
1 parent ea3f3e3 commit 43d2fe8
Show file tree
Hide file tree
Showing 4 changed files with 290 additions and 190 deletions.
3 changes: 2 additions & 1 deletion app/grpc_server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ func run(logger *log.Logger) error {
HttpHost string `conf:"default:0.0.0.0:8000"`
GrpcHost string `conf:"default:0.0.0.0:8001"`
MaxTickFetchUrl string `conf:"default:http://127.0.0.1:8080/max-tick"`
ReadRetryCount int `conf:"default:5"`
}
Pool struct {
NodeFetcherUrl string `conf:"default:http://127.0.0.1:8080/status"`
Expand Down Expand Up @@ -83,7 +84,7 @@ func run(logger *log.Logger) error {
return errors.Wrap(err, "creating qubic pool")
}

rpcServer := rpc.NewServer(cfg.Server.GrpcHost, cfg.Server.HttpHost, logger, pool, cfg.Server.MaxTickFetchUrl)
rpcServer := rpc.NewServer(cfg.Server.GrpcHost, cfg.Server.HttpHost, logger, pool, cfg.Server.MaxTickFetchUrl, cfg.Server.ReadRetryCount)
err = rpcServer.Start()
if err != nil {
return errors.Wrap(err, "starting rpc server")
Expand Down
Loading

0 comments on commit 43d2fe8

Please sign in to comment.