Restrict hotel-page scraper to own + competitor tiers only
Market-tier hotels were auto-discovered from search results and don't need room-level rate tracking — scraping all 25+ of them per date was unnecessary. Only 'own' and 'competitor' hotels are now scraped. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
e472ba65c4
commit
30583c59a4
1 changed files with 6 additions and 2 deletions
|
|
@ -295,12 +295,16 @@ def cleanup_stale_batches(db: Session, max_age_minutes: int = 60):
|
||||||
|
|
||||||
|
|
||||||
def get_active_hotels(db: Session) -> List[Dict[str, Any]]:
|
def get_active_hotels(db: Session) -> List[Dict[str, Any]]:
|
||||||
"""Return all active hotels that have a booking_com_url (needed for hotel-page scraping)."""
|
"""Return own + competitor hotels with a booking_com_url (for hotel-page scraping).
|
||||||
|
Market-tier hotels are excluded — they were auto-discovered from search results and
|
||||||
|
are not hotels we specifically want to track at rate-plan level."""
|
||||||
rows = db.execute(
|
rows = db.execute(
|
||||||
text("""
|
text("""
|
||||||
SELECT id, booking_com_id, name, booking_com_url
|
SELECT id, booking_com_id, name, booking_com_url
|
||||||
FROM booking_com_hotels
|
FROM booking_com_hotels
|
||||||
WHERE is_active = TRUE AND booking_com_url IS NOT NULL
|
WHERE is_active = TRUE
|
||||||
|
AND booking_com_url IS NOT NULL
|
||||||
|
AND tier IN ('own', 'competitor')
|
||||||
ORDER BY display_order, id
|
ORDER BY display_order, id
|
||||||
""")
|
""")
|
||||||
).fetchall()
|
).fetchall()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue