mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-09 14:43:19 +00:00
abci/client: make flush operation sync (#7857)
This follows along in the spirit of #7845 but is orthogonal to removing `CheckTxAsync` (which will come after the previous commit lands,) so I thought I'd get it out there earlier.
This commit is contained in:
@@ -730,7 +730,7 @@ func (txmp *TxMempool) updateReCheckTxs(ctx context.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
if _, err := txmp.proxyAppConn.FlushAsync(ctx); err != nil {
|
||||
if err := txmp.proxyAppConn.Flush(ctx); err != nil {
|
||||
txmp.logger.Error("failed to flush transactions during rechecking", "err", err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,6 @@ type AppConnMempool interface {
|
||||
CheckTxAsync(context.Context, types.RequestCheckTx) (*abciclient.ReqRes, error)
|
||||
CheckTx(context.Context, types.RequestCheckTx) (*types.ResponseCheckTx, error)
|
||||
|
||||
FlushAsync(context.Context) (*abciclient.ReqRes, error)
|
||||
Flush(context.Context) error
|
||||
}
|
||||
|
||||
@@ -148,11 +147,6 @@ func (app *appConnMempool) Error() error {
|
||||
return app.appConn.Error()
|
||||
}
|
||||
|
||||
func (app *appConnMempool) FlushAsync(ctx context.Context) (*abciclient.ReqRes, error) {
|
||||
defer addTimeSample(app.metrics.MethodTiming.With("method", "flush", "type", "async"))()
|
||||
return app.appConn.FlushAsync(ctx)
|
||||
}
|
||||
|
||||
func (app *appConnMempool) Flush(ctx context.Context) error {
|
||||
defer addTimeSample(app.metrics.MethodTiming.With("method", "flush", "type", "sync"))()
|
||||
return app.appConn.Flush(ctx)
|
||||
|
||||
@@ -90,26 +90,3 @@ func (_m *AppConnMempool) Flush(_a0 context.Context) error {
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// FlushAsync provides a mock function with given fields: _a0
|
||||
func (_m *AppConnMempool) FlushAsync(_a0 context.Context) (*abciclient.ReqRes, error) {
|
||||
ret := _m.Called(_a0)
|
||||
|
||||
var r0 *abciclient.ReqRes
|
||||
if rf, ok := ret.Get(0).(func(context.Context) *abciclient.ReqRes); ok {
|
||||
r0 = rf(_a0)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*abciclient.ReqRes)
|
||||
}
|
||||
}
|
||||
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(context.Context) error); ok {
|
||||
r1 = rf(_a0)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user