Skip to content

Commit

Permalink
Merge pull request #478 from LACMTA:2023-api-optimization
Browse files Browse the repository at this point in the history
Refactor sleep durations in websocket_endpoint function
  • Loading branch information
albertkun authored Feb 3, 2024
2 parents 01a807f + f47148e commit 33e6290
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fastapi/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ async def reader(channel: aioredis.client.PubSub):
await websocket.send_text(json.dumps(item))
except Exception as e:
await websocket.send_text(f"Error: {str(e)}")
await asyncio.sleep(3)
await asyncio.sleep(1.5)
except asyncio.TimeoutError:
pass

Expand Down

0 comments on commit 33e6290

Please sign in to comment.