From 16b59c79c11c56a0e6acc8cb4a6564da5ba0b54f Mon Sep 17 00:00:00 2001 From: MyonKeminta Date: Thu, 19 Sep 2024 16:07:10 +0800 Subject: [PATCH] fix lint Signed-off-by: MyonKeminta --- client/tso_dispatcher.go | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/client/tso_dispatcher.go b/client/tso_dispatcher.go index b19482f7b22..b817338137d 100644 --- a/client/tso_dispatcher.go +++ b/client/tso_dispatcher.go @@ -328,7 +328,7 @@ tsoBatchLoop: case td.tsDeadlineCh <- dl: } // processRequests guarantees that the collected requests could be finished properly. - tbcConsumed, err := td.processRequests(stream, dc, batchController, done, false) + tbcConsumed, err := td.processRequests(stream, dc, batchController, done, td.useAsyncStream()) // If error happens during tso stream handling, reset stream and run the next trial. if tbcConsumed { // The function `processRequests` *consumed* the batchController. @@ -523,14 +523,13 @@ func (td *tsoDispatcher) processRequests( return false, err } return true, nil - } else { - result, err := stream.ProcessRequests( - clusterID, keyspaceID, reqKeyspaceGroupID, dcLocation, count, tbc.extraBatchingStartTime) - close(done) - - td.handleTSOResultsForBatch(tbc, stream, result, reqKeyspaceGroupID, err) - return false, err } + result, err := stream.ProcessRequests( + clusterID, keyspaceID, reqKeyspaceGroupID, dcLocation, count, tbc.extraBatchingStartTime) + close(done) + + td.handleTSOResultsForBatch(tbc, stream, result, reqKeyspaceGroupID, err) + return false, err } func (td *tsoDispatcher) handleTSOResultsForBatch(tbc *tsoBatchController, stream *tsoStream, result tsoRequestResult, reqKeyspaceGroupID uint32, err error) { @@ -602,6 +601,6 @@ func (td *tsoDispatcher) compareAndSwapTS( td.lastTSOInfo = curTSOInfo } -func (td *tsoDispatcher) useAsyncStream() bool { +func (*tsoDispatcher) useAsyncStream() bool { return false }