Skip to content

Commit

Permalink
event stream: set timeout to 20 seconds for reading
Browse files Browse the repository at this point in the history
This will hopefully catch if we aren't getting any heartbeats or
com.linkedin.realtimefrontend.ClientConnection events.

Signed-off-by: Sumner Evans <[email protected]>
  • Loading branch information
sumnerevans committed Jan 18, 2024
1 parent f98e4ce commit c16b5f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion linkedin_messaging/linkedin.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ async def _listen_to_event_stream(self):
raise TooManyRequestsError(f"Failed to connect. Status {resp.status}.")

while True:
line = await resp.content.readline()
line = await asyncio.wait_for(resp.content.readline(), timeout=20)
if resp.content.at_eof():
break

Expand Down

0 comments on commit c16b5f5

Please sign in to comment.