Skip to content

Commit 124b043

Browse files
authored
Fix the pool size log to reflect the correct size when the env variable is not set (#172)
1 parent c8b596d commit 124b043

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/PowerShell/PowerShellManagerPool.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,14 @@ internal class PowerShellManagerPool
3131
internal PowerShellManagerPool(MessagingStream msgStream)
3232
{
3333
string upperBound = Environment.GetEnvironmentVariable("PSWorkerInProcConcurrencyUpperBound");
34-
RpcLogger.WriteSystemLog(string.Format(PowerShellWorkerStrings.LogConcurrencyUpperBound, upperBound));
35-
3634
if (string.IsNullOrEmpty(upperBound) || !int.TryParse(upperBound, out _upperBound))
3735
{
3836
_upperBound = 1;
3937
}
4038

4139
_msgStream = msgStream;
4240
_pool = new BlockingCollection<PowerShellManager>(_upperBound);
41+
RpcLogger.WriteSystemLog(string.Format(PowerShellWorkerStrings.LogConcurrencyUpperBound, _upperBound.ToString()));
4342
}
4443

4544
/// <summary>
@@ -84,7 +83,7 @@ internal PowerShellManager CheckoutIdleWorker(StreamingMessage request, AzFuncti
8483
logger.SetContext(requestId, invocationId);
8584
psManager = new PowerShellManager(logger);
8685

87-
RpcLogger.WriteSystemLog(string.Format(PowerShellWorkerStrings.LogNewPowerShellManagerCreated, _poolSize));
86+
RpcLogger.WriteSystemLog(string.Format(PowerShellWorkerStrings.LogNewPowerShellManagerCreated, _poolSize.ToString()));
8887
}
8988
else
9089
{

0 commit comments

Comments
 (0)