Commit ·
9bb5e85
1
Parent(s): 22f3415
fix dont upsert to db
Browse files
main.py
CHANGED
|
@@ -105,14 +105,18 @@ async def run_prediction_batch():
|
|
| 105 |
}
|
| 106 |
|
| 107 |
# 4. Save to database
|
| 108 |
-
response = supabase.table('stock_predictions').upsert(db_row).execute()
|
| 109 |
|
| 110 |
-
if response.data:
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
else:
|
| 114 |
-
|
| 115 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 116 |
except Exception as e:
|
| 117 |
print(f"🚨 An error occurred while processing {ticker}: {e}")
|
| 118 |
continue
|
|
|
|
| 105 |
}
|
| 106 |
|
| 107 |
# 4. Save to database
|
| 108 |
+
# response = supabase.table('stock_predictions').upsert(db_row).execute()
|
| 109 |
|
| 110 |
+
# if response.data:
|
| 111 |
+
# print(f"✅ Successfully predicted and upserted for {ticker}")
|
| 112 |
+
# all_predictions.append(db_row)
|
| 113 |
+
# else:
|
| 114 |
+
# print(f"🚨 DB Error for {ticker}: {response.error.message if response.error else 'Unknown error'}")
|
| 115 |
|
| 116 |
+
# REVISED LOGIC: Just append the results to the list to be returned
|
| 117 |
+
print(f"✅ Successfully predicted for {ticker}")
|
| 118 |
+
all_predictions.append(db_row)
|
| 119 |
+
|
| 120 |
except Exception as e:
|
| 121 |
print(f"🚨 An error occurred while processing {ticker}: {e}")
|
| 122 |
continue
|