Skip to content

Commit

Permalink
change default
Browse files Browse the repository at this point in the history
Signed-off-by: Chengxuan Xing <[email protected]>
  • Loading branch information
Chengxuan committed Aug 12, 2024
1 parent 79519e1 commit 9af06f4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/rpcbackend/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ func NewRPCClientWithOption(ctx context.Context, client *resty.Client, options R
batchDelay = *options.BatchOptions.BatchDelay
}

if options.BatchOptions.BatchSize > 1 {
if options.BatchOptions.BatchSize != 0 {
batchSize = options.BatchOptions.BatchSize
}
if options.BatchOptions.BatchWorkerCount > 1 {
if options.BatchOptions.BatchWorkerCount != 0 {
batchWorkerCount = options.BatchOptions.BatchWorkerCount
}
rpcClient.requestBatchWorkerSlots = make(chan bool, batchWorkerCount)
Expand Down
5 changes: 3 additions & 2 deletions pkg/rpcbackend/backend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -674,8 +674,9 @@ func TestBatchRequestsTestWorkerCounts(t *testing.T) {
rb := NewRPCClientWithOption(ctx, c, RPCClientOptions{
MaxConcurrentRequest: 10,
BatchOptions: &RPCClientBatchOptions{
BatchDelay: &tH, // very long delay, so need to rely on batch size to be hit for sending a batch
BatchSize: 2,
BatchDelay: &tH, // very long delay, so need to rely on batch size to be hit for sending a batch
BatchSize: 2,
BatchWorkerCount: 1,
},
}).(*RPCClient)

Expand Down

0 comments on commit 9af06f4

Please sign in to comment.