Skip to content

Commit

Permalink
Merge pull request #263 from NTFSvolume/fix_main_live_loop
Browse files Browse the repository at this point in the history
fix: multiple running rich.live loops
  • Loading branch information
datawhores authored Nov 12, 2024
2 parents ff4d329 + 2983e89 commit af6f33a
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions cyberdrop_dl/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ async def runtime(manager: Manager) -> None:
if manager.args_manager.sort_all_configs:
return

scrape_mapper = ScrapeMapper(manager)

async with asyncio.TaskGroup() as task_group:
manager.task_group = task_group
await scrape_mapper.start()
with manager.live_manager.get_main_live(stop=True):
scrape_mapper = ScrapeMapper(manager)
async with asyncio.TaskGroup() as task_group:
manager.task_group = task_group
await scrape_mapper.start()


async def post_runtime(manager: Manager) -> None:
Expand Down Expand Up @@ -183,9 +183,8 @@ async def director(manager: Manager) -> None:
log("Starting CDL...\n", 20)

try:
with manager.live_manager.get_main_live(stop=True):
await runtime(manager)
await post_runtime(manager)
await runtime(manager)
await post_runtime(manager)
except* Exception as e:
log_with_color(
f"An error occurred, please report this to the developer: {e}",
Expand Down

0 comments on commit af6f33a

Please sign in to comment.