Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set a default MDOP #250

Merged
merged 1 commit into from
May 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/AzureSignTool/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ internal sealed class SignCommand : Command
internal bool NoPageHashing { get; set; }
internal bool ContinueOnError { get; set; }
internal string? InputFileList { get; set; }
internal int? MaxDegreeOfParallelism { get; set; }
internal int MaxDegreeOfParallelism { get; set; } = 4;
internal bool Colors { get; set; }
internal bool SkipSignedFiles { get; set; }
internal bool AppendSignature { get; set; }
Expand Down Expand Up @@ -266,9 +266,9 @@ private async ValueTask<int> RunSign()
logger.LogInformation("Cancelling signing operations.");
};
var options = new ParallelOptions();
if (MaxDegreeOfParallelism.HasValue)
if (MaxDegreeOfParallelism != 0)
{
options.MaxDegreeOfParallelism = MaxDegreeOfParallelism.Value;
options.MaxDegreeOfParallelism = MaxDegreeOfParallelism;
}
logger.LogTrace("Creating context");

Expand Down Expand Up @@ -453,9 +453,9 @@ private bool ValidateArguments(CommandRunContext context)
valid &= ValidateHashAlgorithm(context, FileDigestAlgorithm, "--file-digest");
valid &= ValidateHashAlgorithm(context, TimestampDigestAlgorithm, "--timestamp-digest");

if (MaxDegreeOfParallelism is < -1 or 0)
if (MaxDegreeOfParallelism < -1)
{
context.Error.WriteLine("'--max-degree-of-parallelism' must be a positive interger, or negative one.");
context.Error.WriteLine("'--max-degree-of-parallelism' must be a positive interger, zero, or -1.");
valid = false;
}

Expand Down