Skip to content

Commit

Permalink
fix: thread conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
BobTheBuidler committed Apr 27, 2023
1 parent 1efc0a9 commit c801d99
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions dank_mids/requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,7 @@ async def get_response(self) -> Optional[_Response]:
pass

def set_done(self, wakeup: bool = True) -> None:
self._done.set()
if wakeup:
# NOTE: We are in a separate thread from the asyncio.Event's event loop.
# In this case we must wake up the event loop manually.
self.controller._wakeup_loop()
asyncio.get_event_loop().call_soon_threadsafe(self._done.set)

### Single requests:

Expand Down

0 comments on commit c801d99

Please sign in to comment.