From 044ef111ac0a7e4370779395f33476f020ce158e Mon Sep 17 00:00:00 2001 From: Aron Date: Sun, 4 Jan 2026 18:32:49 +0100 Subject: [PATCH] fix retry --- application_handler.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/application_handler.py b/application_handler.py index 0ed2f76..efd0818 100644 --- a/application_handler.py +++ b/application_handler.py @@ -108,7 +108,22 @@ class ApplicationHandler: message += f"\nReason: {html.escape(fail_msg)}" else: # Should not happen if logic is correct, but fallback + # Save as failed so /retryfailed can retry later message += "\n\n\u2139\ufe0f No application attempted (internal logic error)" + failed_result = { + "listing_id": listing["id"], + "company": company, + "link": link, + "timestamp": listing.get("timestamp", ""), + "success": False, + "message": "Internal logic error: listing not in application_results", + "address": listing.get("address", ""), + "rooms": listing.get("rooms", ""), + "price": listing.get("price", ""), + "retries": 0 + } + self.save_application(failed_result) + logger.warning(f"[INTERNAL ERROR] Saved as failed: {listing['id']} - {listing.get('address', '')}") else: # Autopilot was off or not attempted at all message += "\n\n\u2139\ufe0f No application attempted (autopilot off)"