Skip to content

Commit

Permalink
optimize rpc pool (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
DuodenumL authored Oct 6, 2021
1 parent c2787d6 commit fc0b4bc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions store/core/rpcpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,11 @@ func NewCoreRPCClientPool(ctx context.Context, config *types.Config) (*ClientPoo
}
rpcClient := rpc.GetRPCClient()
c.rpcClients = append(c.rpcClients, &clientWithStatus{client: rpcClient, addr: addr})
// update client status synchronously
c.updateClientsStatus(ctx, config.GlobalConnectionTimeout)
}

// init client status
c.updateClientsStatus(ctx, config.GlobalConnectionTimeout)

allFailed := true
for _, rpc := range c.rpcClients {
if rpc.alive {
Expand Down

0 comments on commit fc0b4bc

Please sign in to comment.