Skip to content

Commit 3a78be9

Browse files
Bump SonarAnalyzer.CSharp from 9.27.0.93347 to 9.28.0.94264 (#2167)
* Bump SonarAnalyzer.CSharp from 9.27.0.93347 to 9.28.0.94264 Bumps [SonarAnalyzer.CSharp](https://github.com/SonarSource/sonar-dotnet) from 9.27.0.93347 to 9.28.0.94264. - [Release notes](https://github.com/SonarSource/sonar-dotnet/releases) - [Commits](SonarSource/sonar-dotnet@9.27.0.93347...9.28.0.94264) --- updated-dependencies: - dependency-name: SonarAnalyzer.CSharp dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * Fix S1871 warning Combine duplicate code blocks. --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Martin Costello <[email protected]>
1 parent 7105558 commit 3a78be9

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<PackageVersion Include="Polly.Testing" Version="$(PollyVersion)" />
3737
<PackageVersion Include="Polly.Contrib.WaitAndRetry" Version="1.1.1" />
3838
<PackageVersion Include="ReportGenerator" Version="5.3.6" />
39-
<PackageVersion Include="SonarAnalyzer.CSharp" Version="9.27.0.93347" />
39+
<PackageVersion Include="SonarAnalyzer.CSharp" Version="9.28.0.94264" />
4040
<PackageVersion Include="StyleCop.Analyzers" Version="1.2.0-beta.556" />
4141
<PackageVersion Include="System.ComponentModel.Annotations" Version="4.5.0" />
4242
<PackageVersion Include="System.Diagnostics.DiagnosticSource" Version="$(MicrosoftExtensionsVersion)" />

src/Polly.Core/CircuitBreaker/Controller/CircuitStateController.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -209,11 +209,7 @@ public ValueTask OnHandledOutcomeAsync(Outcome<T> outcome, ResilienceContext con
209209
// the metric; we do not want to duplicate-signal onBreak; we do not want to extend time for which the circuit is broken.
210210
// We do not want to mask the fact that the call executed (as replacing its result with a Broken/IsolatedCircuitException would do).
211211

212-
if (_circuitState == CircuitState.HalfOpen)
213-
{
214-
OpenCircuit_NeedsLock(outcome, manual: false, context, out task);
215-
}
216-
else if (_circuitState == CircuitState.Closed && shouldBreak)
212+
if (_circuitState == CircuitState.HalfOpen || (_circuitState == CircuitState.Closed && shouldBreak))
217213
{
218214
OpenCircuit_NeedsLock(outcome, manual: false, context, out task);
219215
}

0 commit comments

Comments
 (0)