Skip to content

Commit

Permalink
Fixing target base scale instance concurrency for queues
Browse files Browse the repository at this point in the history
  • Loading branch information
alrod committed Jan 10, 2024
1 parent 8a70af0 commit d89d719
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public async Task<TargetScalerResult> GetScaleResultAsync(TargetScalerContext co

internal TargetScalerResult GetScaleResultInternal(TargetScalerContext context, int queueLength)
{
int concurrency = !context.InstanceConcurrency.HasValue ? _options.BatchSize : context.InstanceConcurrency.Value;
int concurrency = !context.InstanceConcurrency.HasValue ? _options.BatchSize + _options.NewBatchThreshold : context.InstanceConcurrency.Value;

if (concurrency < 0)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void Setup()
[TestCase(160, 20, 8)]
public void QueueTargetScaler_Returns_Expected(int queueLength, int? concurrency, int expectedTargetWorkerCount)
{
QueuesOptions options = new QueuesOptions { BatchSize = 16 };
QueuesOptions options = new QueuesOptions { BatchSize = 8, NewBatchThreshold = 8 };

TargetScalerContext context = new TargetScalerContext
{
Expand Down

0 comments on commit d89d719

Please sign in to comment.