Skip to content

Commit 05f368f

Browse files
Fix unclosed aiohttp sessions (#63)
1 parent 1be3c3a commit 05f368f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/dipdup/dipdup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,9 @@ async def run(self, reindex: bool, oneshot: bool) -> None:
190190
await asyncio.gather(*datasource_tasks, *worker_tasks)
191191
except KeyboardInterrupt:
192192
pass
193-
194-
self._logger.info('Closing datasource sessions')
195-
await asyncio.gather(*[d.close_session() for d in self._datasources.values()])
193+
finally:
194+
self._logger.info('Closing datasource sessions')
195+
await asyncio.gather(*[d.close_session() for d in self._datasources.values()])
196196

197197
async def migrate(self) -> None:
198198
codegen = DipDupCodeGenerator(self._config, self._datasources_by_config)

0 commit comments

Comments
 (0)