Skip to content

Commit

Permalink
Clear queue on reconnect (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
droserasprout authored Jul 19, 2021
1 parent d7a0888 commit 2566cc1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/dipdup/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@


class Index:
_queue: Deque

def __init__(self, ctx: DipDupContext, config: IndexConfigTemplateT, datasource: TzktDatasource) -> None:
self._ctx = ctx
self._config = config
Expand Down Expand Up @@ -58,6 +60,7 @@ async def process(self) -> None:
await self._synchronize(last_level)
elif self._datasource.sync_level > state.level:
self._logger.info('Index is behind datasource, sync to datasource level')
self._queue.clear()
last_level = self._datasource.sync_level
await self._synchronize(last_level)
else:
Expand Down

0 comments on commit 2566cc1

Please sign in to comment.