-
Notifications
You must be signed in to change notification settings - Fork 84
chore: add check for closed connector #1269
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
base: main
Are you sure you want to change the base?
Conversation
| self._loop.call_soon_threadsafe(self._loop.stop) | ||
| # wait for thread to finish closing (i.e. loop to stop) | ||
| self._thread.join() | ||
| self._closed = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not necessary as synchronous close calls close_async so should get closed by close_async
2629802 to
b8bc912
Compare
| await asyncio.gather(*[cache.close() for cache in self._cache.values()]) | ||
| if self._client: | ||
| await self._client.close() | ||
| self._closed = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do this first, then client.close(), then gather cache.close()
Draft-PR to check if the connector's been closed before trying to connect using the same engine.