mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-14 22:01:20 +00:00
client: use vars for retry intervals
This commit is contained in:
@ -8,6 +8,11 @@ import (
|
|||||||
cmn "github.com/tendermint/tmlibs/common"
|
cmn "github.com/tendermint/tmlibs/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
dialRetryIntervalSeconds = 3
|
||||||
|
echoRetryIntervalSeconds = 1
|
||||||
|
)
|
||||||
|
|
||||||
// Client defines an interface for an ABCI client.
|
// Client defines an interface for an ABCI client.
|
||||||
// All `Async` methods return a `ReqRes` object.
|
// All `Async` methods return a `ReqRes` object.
|
||||||
// All `Sync` methods return the appropriate protobuf ResponseXxx struct and an error.
|
// All `Sync` methods return the appropriate protobuf ResponseXxx struct and an error.
|
||||||
|
@ -56,7 +56,7 @@ RETRY_LOOP:
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
cli.Logger.Error(fmt.Sprintf("abci.grpcClient failed to connect to %v. Retrying...\n", cli.addr))
|
cli.Logger.Error(fmt.Sprintf("abci.grpcClient failed to connect to %v. Retrying...\n", cli.addr))
|
||||||
time.Sleep(time.Second * 3)
|
time.Sleep(time.Second * dialRetryIntervalSeconds)
|
||||||
continue RETRY_LOOP
|
continue RETRY_LOOP
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ RETRY_LOOP:
|
|||||||
if err == nil {
|
if err == nil {
|
||||||
break ENSURE_CONNECTED
|
break ENSURE_CONNECTED
|
||||||
}
|
}
|
||||||
time.Sleep(time.Second)
|
time.Sleep(time.Second * echoRetryIntervalSeconds)
|
||||||
}
|
}
|
||||||
|
|
||||||
cli.client = client
|
cli.client = client
|
||||||
|
@ -68,7 +68,7 @@ RETRY_LOOP:
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
cli.Logger.Error(fmt.Sprintf("abci.socketClient failed to connect to %v. Retrying...", cli.addr))
|
cli.Logger.Error(fmt.Sprintf("abci.socketClient failed to connect to %v. Retrying...", cli.addr))
|
||||||
time.Sleep(time.Second * 3)
|
time.Sleep(time.Second * dialRetryIntervalSeconds)
|
||||||
continue RETRY_LOOP
|
continue RETRY_LOOP
|
||||||
}
|
}
|
||||||
cli.conn = conn
|
cli.conn = conn
|
||||||
|
Reference in New Issue
Block a user