File tree Expand file tree Collapse file tree 5 files changed +27
-12
lines changed
src/dipdup/datasources/tzkt Expand file tree Collapse file tree 5 files changed +27
-12
lines changed Original file line number Diff line number Diff line change @@ -4,25 +4,26 @@ Please use [this](https://docs.gitlab.com/ee/development/changelog.html) documen
44
55## [ unreleased]
66
7- ## Added
7+ ### Added
88
99* tzkt: Added optional ` delegate_address ` and ` delegate_alias ` fields to ` OperationData ` .
1010
11- ## Fixed
11+ ### Fixed
1212
13- * tzkt: Fixed incorrect parsing of ` OperationData.amount ` field.
13+ * tzkt: Fixed crash due to unprocessed pysignalr exception.
14+ * tzkt: Fixed parsing ` OperationData.amount ` field.
1415
1516## 4.0.1 - 2021-12-30
1617
17- ## Fixed
18+ ### Fixed
1819
1920* codegen: Fixed generating storage typeclasses with ` Union ` fields.
2021* codegen: Fixed preprocessing contract JSONSchema.
2122* index: Fixed processing reindexing reason saved in the database.
2223* tzkt: Fixed processing operations with default entrypoint and empty parameter.
2324* tzkt: Fixed crash while recursively applying bigmap diffs to the storage.
2425
25- ## Performance
26+ ### Performance
2627
2728* tzkt: Increased speed of applying bigmap diffs to operation storage.
2829
Original file line number Diff line number Diff line change 11.ONESHELL :
2- .PHONY : test
2+ .PHONY : test build
33.DEFAULT_GOAL : all
44
55DEV =1
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ datamodel-code-generator = "^0.11.1"
3232fcache = " ^0.4.7"
3333pydantic = " ^1.8.1"
3434pyhumps = " ^3.0.2"
35- pysignalr = " ^0.1.0 "
35+ pysignalr = " ^0.1.1 "
3636pytezos = {version = " ^3.2.4" , optional = true }
3737python-dotenv = " ^0.18.0"
3838"ruamel.yaml" = " ^0.17.2"
Original file line number Diff line number Diff line change 11import asyncio
22import logging
3+ import sys
34from asyncio import Event
45from asyncio import create_task
56from asyncio import gather
2425
2526from aiohttp import ClientResponseError
2627from pysignalr .client import SignalRClient
28+ from pysignalr .exceptions import ConnectionError as WebsocketConnectionError
2729from pysignalr .messages import CompletionMessage # type: ignore
2830from pysignalr .transport .websocket import DEFAULT_MAX_SIZE
2931
@@ -594,7 +596,19 @@ def _get_ws_client(self) -> SignalRClient:
594596
595597 async def run (self ) -> None :
596598 self ._logger .info ('Establishing realtime connection' )
597- tasks = [create_task (self ._get_ws_client ().run ())]
599+ ws = self ._get_ws_client ()
600+
601+ async def _wrapper ():
602+ retry_sleep = self ._http_config .retry_sleep
603+ for _ in range (self ._http_config .retry_count or sys .maxsize ):
604+ try :
605+ await ws .run ()
606+ except WebsocketConnectionError as e :
607+ self ._logger .error ('Websocket connection error: %s' , e )
608+ await asyncio .sleep (retry_sleep )
609+ retry_sleep *= self ._http_config .retry_multiplier
610+
611+ tasks = [create_task (_wrapper ())]
598612
599613 if self ._watchdog :
600614 tasks .append (create_task (self ._watchdog .run ()))
You can’t perform that action at this time.
0 commit comments