-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Don't log an error when a BackgroundService is canceled due to the host being stopped. #57005
Conversation
…st being stopped. Fix dotnet#56032
Tagging subscribers to this area: @eerhardt, @maryamariyan |
src/libraries/Microsoft.Extensions.Hosting/src/Internal/Host.cs
Outdated
Show resolved
Hide resolved
I think you could simplify this by never unsetting the stopping flag. |
I thought about that, but it feels wrong to still have "_stopping = true" once the Host is done stopping. Maybe I could rename it to |
Yep lets rename it. Since you can't restart it simplifies the thing. Well the indenting 😄 |
src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/Internal/HostTests.cs
Outdated
Show resolved
Hide resolved
src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/Internal/HostTests.cs
Outdated
Show resolved
Hide resolved
- Make it obvious the test is using the default worker template
Fix #56032