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
|
|
@ -1,10 +1,13 @@
|
|||
"""Route calculator service - calculates transit routes using Google Maps API."""
|
||||
import asyncio
|
||||
import logging
|
||||
from models.listing import DestinationMode, Route, RouteLegStep
|
||||
from repositories.listing_repository import ListingRepository
|
||||
from tqdm.asyncio import tqdm
|
||||
from rec import routing
|
||||
from models import Listing
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def _parse_duration(duration_str: str) -> int:
|
||||
"""Parse a duration string like '123s' to integer seconds."""
|
||||
|
|
@ -24,11 +27,11 @@ async def calculate_route(
|
|||
listings = listings[:limit]
|
||||
|
||||
destination_mode = DestinationMode(destination_address, travel_mode)
|
||||
updated_listings = await tqdm.gather(
|
||||
logger.info("Calculating routes for %d listings", len(listings))
|
||||
updated_listings = await asyncio.gather(
|
||||
*[update_routing_info(listing, destination_mode) for listing in listings],
|
||||
total=len(listings),
|
||||
desc="Updating routing info",
|
||||
)
|
||||
logger.info("Finished route calculation 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