diff --git a/backend/services/booking_scraper.py b/backend/services/booking_scraper.py index 3a5f310..c080aa1 100644 --- a/backend/services/booking_scraper.py +++ b/backend/services/booking_scraper.py @@ -76,13 +76,13 @@ def force_reset_scraper(db: Session) -> dict: hotels_found = ( SELECT COUNT(DISTINCT hotel_id) FROM booking_com_rates - WHERE scrape_batch_id = bsl.batch_id::text + WHERE scrape_batch_id = bsl.batch_id AND rate_gross IS NOT NULL ), rates_scraped = ( SELECT COUNT(*) FROM booking_com_rates - WHERE scrape_batch_id = bsl.batch_id::text + WHERE scrape_batch_id = bsl.batch_id AND rate_gross IS NOT NULL ) WHERE status = 'running' @@ -304,13 +304,13 @@ def cleanup_stale_batches(db: Session, max_age_minutes: int = 60): hotels_found = ( SELECT COUNT(DISTINCT hotel_id) FROM booking_com_rates - WHERE scrape_batch_id = bsl.batch_id::text + WHERE scrape_batch_id = bsl.batch_id AND rate_gross IS NOT NULL ), rates_scraped = ( SELECT COUNT(*) FROM booking_com_rates - WHERE scrape_batch_id = bsl.batch_id::text + WHERE scrape_batch_id = bsl.batch_id AND rate_gross IS NOT NULL ) WHERE bsl.status = 'running'