diff --git a/worker/src/main.py b/worker/src/main.py index f040201..06a8202 100644 --- a/worker/src/main.py +++ b/worker/src/main.py @@ -74,6 +74,13 @@ async def scheduler_task(pool: object, bot: ExtBot) -> None: fields.get("main_image_url"), fields.get("postcode"), fields.get("modified_at"), ) ad_uuid = str(ad_row["id"]) + + # Only notify for genuinely new ads after baseline load is done + if initial_loaded: + notify_fields = {**fields, "keyword": keyword} + for tg_id in telegram_ids: + await notify_new_ad(bot, tg_id, notify_fields) + new_count += 1 else: ad_uuid = str(existing["id"]) old_price = existing["price"] @@ -96,12 +103,6 @@ async def scheduler_task(pool: object, bot: ExtBot) -> None: fields.get("main_image_url"), fields.get("postcode"), ad_uuid, ) - if initial_loaded: - notify_fields = {**fields, "keyword": keyword} - for tg_id in telegram_ids: - await notify_new_ad(bot, tg_id, notify_fields) - new_count += 1 - if is_price_drop: notify_fields = {**fields, "keyword": keyword} for tg_id in telegram_ids: