Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
  • Loading branch information
MyonKeminta committed Sep 19, 2024
1 parent 7568524 commit 16b59c7
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions client/tso_dispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -523,14 +523,13 @@ func (td *tsoDispatcher) processRequests(
return false, err

Check warning on line 523 in client/tso_dispatcher.go

View check run for this annotation

Codecov / codecov/patch

client/tso_dispatcher.go#L522-L523

Added lines #L522 - L523 were not covered by tests
}
return true, nil

Check warning on line 525 in client/tso_dispatcher.go

View check run for this annotation

Codecov / codecov/patch

client/tso_dispatcher.go#L525

Added line #L525 was not covered by tests
} 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) {
Expand Down Expand Up @@ -602,6 +601,6 @@ func (td *tsoDispatcher) compareAndSwapTS(
td.lastTSOInfo = curTSOInfo
}

func (td *tsoDispatcher) useAsyncStream() bool {
func (*tsoDispatcher) useAsyncStream() bool {
return false
}

0 comments on commit 16b59c7

Please sign in to comment.