Skip to content

Commit

Permalink
Update NuGet packages (#1849)
Browse files Browse the repository at this point in the history
- Update NuGet packages to their latest versions while dependabot is unable to correctly do the updates.
- Fix/suppress new SonarAnalyzer.CSharp warnings.
  • Loading branch information
martincostello committed Jan 4, 2024
1 parent 0d4fbdc commit 2d4f6ab
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
]
}
}
}
}
8 changes: 4 additions & 4 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="coverlet.msbuild" Version="6.0.0" />
<PackageVersion Include="BenchmarkDotNet" Version="0.13.10" />
<PackageVersion Include="BenchmarkDotNet" Version="0.13.11" />
<PackageVersion Include="FluentAssertions" Version="6.12.0" />
<PackageVersion Include="GitHubActionsTestLogger" Version="2.3.3" />
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="6.0.0" />
Expand All @@ -32,14 +32,14 @@
<PackageVersion Include="Polly.Testing" Version="$(PollyVersion)" />
<PackageVersion Include="Polly.Contrib.WaitAndRetry" Version="1.1.1" />
<PackageVersion Include="ReportGenerator" Version="5.2.0" />
<PackageVersion Include="SonarAnalyzer.CSharp" Version="9.12.0.78982" />
<PackageVersion Include="SonarAnalyzer.CSharp" Version="9.15.0.81779" />
<PackageVersion Include="StyleCop.Analyzers" Version="1.2.0-beta.507" />
<PackageVersion Include="System.ComponentModel.Annotations" Version="4.5.0" />
<PackageVersion Include="System.Diagnostics.DiagnosticSource" Version="$(MicrosoftExtensionsVersion)" />
<PackageVersion Include="System.Threading.RateLimiting" Version="$(MicrosoftExtensionsVersion)" />
<PackageVersion Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
<PackageVersion Include="System.ValueTuple" Version="4.5.0" />
<PackageVersion Include="xunit" Version="2.6.2" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.4" />
<PackageVersion Include="xunit" Version="2.6.3" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.5" />
</ItemGroup>
</Project>
6 changes: 4 additions & 2 deletions src/Polly.Core/Utils/Pipeline/ReloadableComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ private void TryRegisterOnReload()
return;
}

#pragma warning disable S3878 // Arrays should not be created for params parameters
_tokenSource = CancellationTokenSource.CreateLinkedTokenSource([.. _reloadTokens]);
#pragma warning restore S3878 // Arrays should not be created for params parameters
_registration = _tokenSource.Token.Register(() =>
{
var context = ResilienceContextPool.Shared.Get().Initialize<VoidResult>(isSynchronous: true);
Expand Down Expand Up @@ -93,20 +95,20 @@ private async Task DisposeDiscardedComponentSafeAsync(PipelineComponent componen
ResilienceContextPool.Shared.Return(context);
}

#pragma warning disable S2952 // Classes should "Dispose" of members from the classes' own "Dispose" methods
private void DisposeRegistration()
{
_registration.Dispose();
_tokenSource.Dispose();
}
#pragma warning restore S2952 // Classes should "Dispose" of members from the classes' own "Dispose" methods

internal record ReloadFailedArguments(Exception Exception);

internal record DisposedFailedArguments(Exception Exception);

#pragma warning disable S2094 // Classes should not be empty
#pragma warning disable S3253 // Constructor and destructor declarations should not be redundant
internal record OnReloadArguments();
#pragma warning restore S3253 // Constructor and destructor declarations should not be redundant
#pragma warning restore S2094 // Classes should not be empty

internal record Entry(PipelineComponent Component, List<CancellationToken> ReloadTokens, ResilienceStrategyTelemetry Telemetry);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public static TBuilder AddRateLimiter<TBuilder>(

return builder.AddRateLimiter(new RateLimiterStrategyOptions
{
RateLimiter = args => limiter.AcquireAsync(1, args.Context.CancellationToken),
RateLimiter = args => limiter.AcquireAsync(cancellationToken: args.Context.CancellationToken),
});
}

Expand Down Expand Up @@ -115,7 +115,7 @@ public static TBuilder AddRateLimiter<TBuilder>(
{
var defaultLimiter = new ConcurrencyLimiter(options.DefaultRateLimiterOptions);
wrapper = new DisposeWrapper(defaultLimiter);
limiter = args => defaultLimiter.AcquireAsync(1, args.Context.CancellationToken);
limiter = args => defaultLimiter.AcquireAsync(cancellationToken: args.Context.CancellationToken);
}

return new RateLimiterResilienceStrategy(
Expand Down

0 comments on commit 2d4f6ab

Please sign in to comment.