Skip to content

Commit

Permalink
Fix SA1414 warning (#2172)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zombach committed Jul 3, 2024
1 parent 0c9bef1 commit e622a7d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bench/Polly.Benchmarks/Polly.Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<Nullable>enable</Nullable>
<ProjectType>Benchmark</ProjectType>
<NoWarn>$(NoWarn);CA1822;SA1414;IDE0060</NoWarn>
<NoWarn>$(NoWarn);CA1822;IDE0060</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Polly/Bulkhead/BulkheadSemaphoreFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace Polly.Bulkhead;

internal static class BulkheadSemaphoreFactory
{
public static (SemaphoreSlim, SemaphoreSlim) CreateBulkheadSemaphores(int maxParallelization, int maxQueueingActions)
public static (SemaphoreSlim MaxParallelizationSemaphore, SemaphoreSlim MaxQueuedActionsSemaphore) CreateBulkheadSemaphores(int maxParallelization, int maxQueueingActions)
{
var maxParallelizationSemaphore = new SemaphoreSlim(maxParallelization, maxParallelization);

Expand Down
4 changes: 4 additions & 0 deletions src/Polly/Caching/IAsyncCacheProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace Polly.Caching;
/// </summary>
public interface IAsyncCacheProvider
{
#pragma warning disable SA1414
/// <summary>
/// Gets a value from the cache asynchronously.
/// </summary>
Expand All @@ -17,6 +18,7 @@ public interface IAsyncCacheProvider
/// the key was found in the cache, and whose second element is the value from the cache (null if not found).
/// </returns>
Task<(bool, object?)> TryGetAsync(string key, CancellationToken cancellationToken, bool continueOnCapturedContext);
#pragma warning restore SA1414

/// <summary>
/// Puts the specified value in the cache asynchronously.
Expand All @@ -36,6 +38,7 @@ public interface IAsyncCacheProvider
/// <typeparam name="TResult">The type of the result.</typeparam>
public interface IAsyncCacheProvider<TResult>
{
#pragma warning disable SA1414
/// <summary>
/// Gets a value from the cache asynchronously.
/// </summary>
Expand All @@ -47,6 +50,7 @@ public interface IAsyncCacheProvider<TResult>
/// the key was found in the cache, and whose second element is the value from the cache (default(TResult) if not found).
/// </returns>
Task<(bool, TResult?)> TryGetAsync(string key, CancellationToken cancellationToken, bool continueOnCapturedContext);
#pragma warning restore SA1414

/// <summary>
/// Puts the specified value in the cache asynchronously.
Expand Down
4 changes: 4 additions & 0 deletions src/Polly/Caching/ISyncCacheProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace Polly.Caching;
/// </summary>
public interface ISyncCacheProvider
{
#pragma warning disable SA1414
/// <summary>
/// Gets a value from cache.
/// </summary>
Expand All @@ -15,6 +16,7 @@ public interface ISyncCacheProvider
/// and whose second element is the value from the cache (null if not found).
/// </returns>
(bool, object?) TryGet(string key);
#pragma warning restore SA1414

/// <summary>
/// Puts the specified value in the cache.
Expand All @@ -31,6 +33,7 @@ public interface ISyncCacheProvider
/// <typeparam name="TResult">The type of the result.</typeparam>
public interface ISyncCacheProvider<TResult>
{
#pragma warning disable SA1414
/// <summary>
/// Gets a value from cache.
/// </summary>
Expand All @@ -40,6 +43,7 @@ public interface ISyncCacheProvider<TResult>
/// and whose second element is the value from the cache (default(TResult) if not found).
/// </returns>
(bool, TResult?) TryGet(string key);
#pragma warning restore SA1414

/// <summary>
/// Puts the specified value in the cache.
Expand Down
1 change: 0 additions & 1 deletion src/Polly/Polly.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<IncludePollyUsings>true</IncludePollyUsings>
<NoWarn>$(NoWarn);CA1010;CA1031;CA1032;CA1033;CA1051;CA1062;CA1063;CA1064;CA1068;CA1710;CA1716;CA1724;CA1805;CA1815;CA1816;CA2211</NoWarn>
<NoWarn>$(NoWarn);S2223;S3215;S3246;S3971;S4039;S4049;S4457</NoWarn>
<NoWarn>$(NoWarn);SA1414</NoWarn>
<!--Public API Analyzers: We do not need to fix these as it would break compatibility with released Polly versions-->
<NoWarn>$(NoWarn);RS0037;</NoWarn>
</PropertyGroup>
Expand Down

0 comments on commit e622a7d

Please sign in to comment.