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

fix: don't access disposed resources #738

Merged
merged 2 commits into from
Mar 21, 2024

Conversation

nachtjasmin
Copy link
Contributor

This PR is ensuring that the host does not stop with an exception. Those exceptions were occuring because the CancellationTokenSource inside the hosted services was already disposed when StopAsync got called.
The reason for this is that the host invokes DisposeAsync before StopAsync.

@nachtjasmin nachtjasmin force-pushed the fix/async-disposable branch from c047dbd to 3d1ffad Compare March 19, 2024 12:58
@nachtjasmin nachtjasmin marked this pull request as draft March 19, 2024 14:56
@nachtjasmin nachtjasmin marked this pull request as ready for review March 21, 2024 08:38
@buehler buehler merged commit f524069 into buehler:main Mar 21, 2024
3 checks passed
@buehler
Copy link
Owner

buehler commented Mar 21, 2024

Thank you @nachtjasmin :-)

Wow, I did not remember these async patterns to be this verbose 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants