Skip to content

Commit

Permalink
Fix the pool size log to reflect the correct size when the env variab…
Browse files Browse the repository at this point in the history
…le is not set (#172)
  • Loading branch information
daxian-dbw authored Mar 20, 2019
1 parent c8b596d commit 124b043
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/PowerShell/PowerShellManagerPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,14 @@ internal class PowerShellManagerPool
internal PowerShellManagerPool(MessagingStream msgStream)
{
string upperBound = Environment.GetEnvironmentVariable("PSWorkerInProcConcurrencyUpperBound");
RpcLogger.WriteSystemLog(string.Format(PowerShellWorkerStrings.LogConcurrencyUpperBound, upperBound));

if (string.IsNullOrEmpty(upperBound) || !int.TryParse(upperBound, out _upperBound))
{
_upperBound = 1;
}

_msgStream = msgStream;
_pool = new BlockingCollection<PowerShellManager>(_upperBound);
RpcLogger.WriteSystemLog(string.Format(PowerShellWorkerStrings.LogConcurrencyUpperBound, _upperBound.ToString()));
}

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

RpcLogger.WriteSystemLog(string.Format(PowerShellWorkerStrings.LogNewPowerShellManagerCreated, _poolSize));
RpcLogger.WriteSystemLog(string.Format(PowerShellWorkerStrings.LogNewPowerShellManagerCreated, _poolSize.ToString()));
}
else
{
Expand Down

0 comments on commit 124b043

Please sign in to comment.