Skip to content

Commit

Permalink
Re-subscribe in case of an error from Trade Republic (#133)
Browse files Browse the repository at this point in the history
Thanks for the fix
  • Loading branch information
RealCLanger authored Nov 5, 2024
1 parent 3280e88 commit 50ad548
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pytr/dl.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ async def dl_loop(self):
try:
_, subscription, response = await self.tr.recv()
except TradeRepublicError as e:
self.log.fatal(str(e))
self.log.error(f"Error response for subscription \"{e.subscription}\". Re-subscribing...")
await self.tr.subscribe(e.subscription)
continue

if subscription.get("type", "") == "timelineTransactions":
await self.tl.get_next_timeline_transactions(response)
Expand Down

0 comments on commit 50ad548

Please sign in to comment.