sunheycho commited on
Commit
8e8cd50
Β·
1 Parent(s): 227b8f4

Debug: Add emergency import test when coordinator is None

Browse files

- Add real-time import test in endpoint when coordinator is None
- This will show the exact import error at request time
- Helps identify if it's a startup issue or runtime issue

Files changed (1) hide show
  1. api.py +9 -0
api.py CHANGED
@@ -972,6 +972,15 @@ def start_product_comparison():
972
 
973
  if get_product_comparison_coordinator is None:
974
  print(f"[DEBUG] ❌ Product comparison coordinator is None - returning 500")
 
 
 
 
 
 
 
 
 
975
  return jsonify({"error": "Product comparison module not available"}), 500
976
 
977
  try:
 
972
 
973
  if get_product_comparison_coordinator is None:
974
  print(f"[DEBUG] ❌ Product comparison coordinator is None - returning 500")
975
+ # Try to import again and show the error
976
+ print(f"[DEBUG] πŸ”„ Attempting emergency import test...")
977
+ try:
978
+ from product_comparison import get_product_comparison_coordinator as test_coordinator
979
+ print(f"[DEBUG] 🎯 Emergency import succeeded: {test_coordinator}")
980
+ except Exception as e:
981
+ print(f"[DEBUG] ❌ Emergency import failed: {e}")
982
+ import traceback
983
+ traceback.print_exc()
984
  return jsonify({"error": "Product comparison module not available"}), 500
985
 
986
  try: