mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-22 09:21:32 +00:00
lint: remove dot import (go-common)
Spell out the package explicitly. This commit is totally textual, and does not change any logic. The swiss-army knife package may serve a kick-start in early stage development. But as the codebase growing, we might want to retire it gradually: For simple wrapping functions, just inline it on the call site. For larger pice of code, make it an independent package.
This commit is contained in:
@ -11,7 +11,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/tendermint/abci/types"
|
||||
. "github.com/tendermint/go-common"
|
||||
common "github.com/tendermint/go-common"
|
||||
)
|
||||
|
||||
const (
|
||||
@ -27,10 +27,10 @@ const flushThrottleMS = 20 // Don't wait longer than...
|
||||
// the application in general is not meant to be interfaced
|
||||
// with concurrent callers.
|
||||
type socketClient struct {
|
||||
BaseService
|
||||
common.BaseService
|
||||
|
||||
reqQueue chan *ReqRes
|
||||
flushTimer *ThrottleTimer
|
||||
flushTimer *common.ThrottleTimer
|
||||
mustConnect bool
|
||||
|
||||
mtx sync.Mutex
|
||||
@ -45,14 +45,14 @@ type socketClient struct {
|
||||
func NewSocketClient(addr string, mustConnect bool) (*socketClient, error) {
|
||||
cli := &socketClient{
|
||||
reqQueue: make(chan *ReqRes, reqQueueSize),
|
||||
flushTimer: NewThrottleTimer("socketClient", flushThrottleMS),
|
||||
flushTimer: common.NewThrottleTimer("socketClient", flushThrottleMS),
|
||||
mustConnect: mustConnect,
|
||||
|
||||
addr: addr,
|
||||
reqSent: list.New(),
|
||||
resCb: nil,
|
||||
}
|
||||
cli.BaseService = *NewBaseService(nil, "socketClient", cli)
|
||||
cli.BaseService = *common.NewBaseService(nil, "socketClient", cli)
|
||||
|
||||
_, err := cli.Start() // Just start it, it's confusing for callers to remember to start.
|
||||
return cli, err
|
||||
@ -65,12 +65,12 @@ func (cli *socketClient) OnStart() error {
|
||||
var conn net.Conn
|
||||
RETRY_LOOP:
|
||||
for {
|
||||
conn, err = Connect(cli.addr)
|
||||
conn, err = common.Connect(cli.addr)
|
||||
if err != nil {
|
||||
if cli.mustConnect {
|
||||
return err
|
||||
} else {
|
||||
log.Warn(Fmt("abci.socketClient failed to connect to %v. Retrying...", cli.addr))
|
||||
log.Warn(common.Fmt("abci.socketClient failed to connect to %v. Retrying...", cli.addr))
|
||||
time.Sleep(time.Second * 3)
|
||||
continue RETRY_LOOP
|
||||
}
|
||||
@ -109,7 +109,7 @@ func (cli *socketClient) StopForError(err error) {
|
||||
}
|
||||
cli.mtx.Unlock()
|
||||
|
||||
log.Warn(Fmt("Stopping abci.socketClient for error: %v", err.Error()))
|
||||
log.Warn(common.Fmt("Stopping abci.socketClient for error: %v", err.Error()))
|
||||
cli.Stop()
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user