Spaces:
Sleeping
Sleeping
Upload app/api/seed.py
Browse files- app/api/seed.py +4 -3
app/api/seed.py
CHANGED
|
@@ -98,10 +98,11 @@ async def seed_database(clear: bool = False, db: Session = Depends(get_db)):
|
|
| 98 |
statusCode=200,
|
| 99 |
)
|
| 100 |
|
| 101 |
-
json_path = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), "
|
| 102 |
-
|
|
|
|
| 103 |
if not os.path.exists(json_path):
|
| 104 |
-
json_path = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), "
|
| 105 |
|
| 106 |
if not os.path.exists(json_path):
|
| 107 |
return AuthResponse(
|
|
|
|
| 98 |
statusCode=200,
|
| 99 |
)
|
| 100 |
|
| 101 |
+
json_path = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), "real_products_scraped.json")
|
| 102 |
+
|
| 103 |
+
# Fallback to real_products_500.json if scraped file not found
|
| 104 |
if not os.path.exists(json_path):
|
| 105 |
+
json_path = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), "real_products_500.json")
|
| 106 |
|
| 107 |
if not os.path.exists(json_path):
|
| 108 |
return AuthResponse(
|