Skip to content

Commit

Permalink
Fix subscriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
droserasprout committed Aug 5, 2021
1 parent 4b4b430 commit 2468746
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
14 changes: 7 additions & 7 deletions src/demo_tezos_domains/dipdup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ database:
path: tezos_domains.sqlite3

contracts:
edo_name_registry:
address: KT1JJbWfW8CHUY95hG9iq2CEMma1RiKhMHDR
mainnet_name_registry:
address: KT1GBZmSxmnKJXGMdMLbugPfLyUPmuLSMwKS
typename: name_registry

datasources:
tzkt_edo:
tzkt_mainnet:
kind: tzkt
url: ${TZKT_URL:-https://api.edo2net.tzkt.io}
url: ${TZKT_URL:-https://api.tzkt.io}

templates:
tezos_domains:
Expand All @@ -34,8 +34,8 @@ templates:
entrypoint: execute

indexes:
tezos_domains_edo:
tezos_domains_mainnet:
template: tezos_domains
values:
datasource: tzkt_edo
name_registry: edo_name_registry
datasource: tzkt_mainnet
name_registry: mainnet_name_registry
5 changes: 4 additions & 1 deletion src/dipdup/datasources/tzkt/datasource.py
Original file line number Diff line number Diff line change
Expand Up @@ -555,9 +555,12 @@ async def run(self) -> None:
async def _on_connect(self) -> None:
"""Subscribe to all required channels on established WS connection"""
self._logger.info('Connected to server')
self._subscriptions.reset()
await self.subscribe()

async def _on_disconnect(self) -> None:
self._logger.info('Disconnected from server')
self._subscriptions.reset()

async def subscribe(self) -> None:
"""Subscribe to all required channels"""
if not self._realtime:
Expand Down

0 comments on commit 2468746

Please sign in to comment.