mirror of
https://github.com/Garmelon/PFERD.git
synced 2025-07-12 06:02:31 +02:00
Use conductor via context manager
This commit is contained in:
@ -63,11 +63,8 @@ class Crawler(ABC):
|
||||
return self.progress_bar(desc, total=size)
|
||||
|
||||
async def run(self) -> None:
|
||||
await self._conductor.start()
|
||||
try:
|
||||
async with self._conductor:
|
||||
await self.crawl()
|
||||
finally:
|
||||
await self._conductor.stop()
|
||||
|
||||
@abstractmethod
|
||||
async def crawl(self) -> None:
|
||||
|
Reference in New Issue
Block a user