Skip to content

Commit

Permalink
lsp: Unset _client_creating task
Browse files Browse the repository at this point in the history
This prevents us from effectively caching the error state and allowing
the server to retry a failed application creation.
  • Loading branch information
alcarney committed Nov 3, 2023
1 parent 1d4b4d0 commit 1c3b10f
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,11 @@ async def get_client(self, uri: Uri) -> Optional[SphinxClient]:

# Create a new client instance.
self._client_creating = asyncio.create_task(self._create_client(uri))
return await self._client_creating
try:
return await self._client_creating
finally:
# Be sure to unset the task when it resolves
self._client_creating = None

async def _create_client(self, uri: Uri) -> Optional[SphinxClient]:
"""Create a new sphinx client instance."""
Expand Down

0 comments on commit 1c3b10f

Please sign in to comment.