mirror of
https://github.com/chainstacklabs/pumpfun-bonkfun-bot.git
synced 2026-08-18 17:58:06 +00:00
Update src/monitoring/pumpportal_listener.py
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
parent
473b1bec70
commit
4bb6b6ae99
@@ -83,13 +83,17 @@ class PumpPortalListener(BaseTokenListener):
|
|||||||
|
|
||||||
except websockets.exceptions.ConnectionClosed:
|
except websockets.exceptions.ConnectionClosed:
|
||||||
logger.warning("PumpPortal WebSocket connection closed. Reconnecting...")
|
logger.warning("PumpPortal WebSocket connection closed. Reconnecting...")
|
||||||
|
finally:
|
||||||
ping_task.cancel()
|
ping_task.cancel()
|
||||||
|
try:
|
||||||
|
await ping_task
|
||||||
|
except asyncio.CancelledError:
|
||||||
|
pass
|
||||||
|
|
||||||
except Exception as e:
|
except Exception:
|
||||||
logger.error(f"PumpPortal WebSocket connection error: {e}")
|
logger.exception("PumpPortal WebSocket connection error")
|
||||||
logger.info("Reconnecting in 5 seconds...")
|
logger.info("Reconnecting in 5 seconds...")
|
||||||
await asyncio.sleep(5)
|
await asyncio.sleep(5)
|
||||||
|
|
||||||
async def _subscribe_to_new_tokens(self, websocket) -> None:
|
async def _subscribe_to_new_tokens(self, websocket) -> None:
|
||||||
"""Subscribe to new token events from PumpPortal.
|
"""Subscribe to new token events from PumpPortal.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user