Remove watchdog and tqdm dependencies, replace with logging
- Remove watchdog (unused) and tqdm from pyproject.toml dependencies - Replace tqdm.gather() with asyncio.gather() + logger.info() in image_fetcher, floorplan_detector, and route_calculator services - Replace tqdm progress bar with logger.info() in listing_repository - Remove tqdm from mypy ignore_missing_imports overrides
This commit is contained in:
parent
d488208a26
commit
cde3540a1e
5 changed files with 19 additions and 13 deletions
|
|
@ -8,7 +8,6 @@ import aiohttp
|
|||
from rec.exceptions import FloorplanDownloadError
|
||||
from repositories import ListingRepository
|
||||
from tenacity import retry, stop_after_attempt, wait_random
|
||||
from tqdm.asyncio import tqdm
|
||||
|
||||
from models import Listing
|
||||
|
||||
|
|
@ -26,13 +25,15 @@ async def dump_images(
|
|||
) -> None:
|
||||
"""Download floorplan images for all listings."""
|
||||
listings = await repository.get_listings()
|
||||
logger.info("Downloading images for %d listings", len(listings))
|
||||
async with aiohttp.ClientSession() as session:
|
||||
updated_listings = await tqdm.gather(
|
||||
updated_listings = await asyncio.gather(
|
||||
*[
|
||||
dump_images_for_listing(listing, image_base_path, session=session)
|
||||
for listing in listings
|
||||
]
|
||||
)
|
||||
logger.info("Finished downloading images for %d listings", len(listings))
|
||||
await repository.upsert_listings(
|
||||
[listing for listing in updated_listings if listing is not None]
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue