Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -24,25 +24,28 @@ supabase: Client = create_client(url, key)
|
|
24 |
@app.post("/send/batch_processing")
|
25 |
async def testv1(request: Request, background_tasks: BackgroundTasks):
|
26 |
try:
|
27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
|
29 |
-
#
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
}
|
35 |
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
)
|
41 |
-
|
42 |
-
# Add processing to background tasks
|
43 |
-
background_tasks.add_task(process_batch_job, dataset, save_data['batch_job_id'])
|
44 |
|
45 |
-
return {'data': 'Batch job is scheduled!', 'batch_job_id': save_data['batch_job_id']}
|
46 |
|
47 |
|
48 |
except Exception as e:
|
|
|
24 |
@app.post("/send/batch_processing")
|
25 |
async def testv1(request: Request, background_tasks: BackgroundTasks):
|
26 |
try:
|
27 |
+
body_data = await request.json()
|
28 |
+
|
29 |
+
print(body_data)
|
30 |
+
# # Create initial batch job record
|
31 |
+
# save_data = {
|
32 |
+
# 'batch_job_id': f"batch_{datetime.utcnow().strftime('%Y%m%d_%H%M%S')}",
|
33 |
+
# "batch_job_status": False,
|
34 |
+
# "created_at": datetime.utcnow().isoformat()
|
35 |
+
# }
|
36 |
|
37 |
+
# response = (
|
38 |
+
# supabase.table("batch_processing_details")
|
39 |
+
# .insert(save_data)
|
40 |
+
# .execute()
|
41 |
+
# )
|
|
|
42 |
|
43 |
+
# # Add processing to background tasks
|
44 |
+
# background_tasks.add_task(process_batch_job, dataset, save_data['batch_job_id'])
|
45 |
+
|
46 |
+
return {'data': 'Batch job is scheduled!'}
|
|
|
|
|
|
|
|
|
47 |
|
48 |
+
# return {'data': 'Batch job is scheduled!', 'batch_job_id': save_data['batch_job_id']}
|
49 |
|
50 |
|
51 |
except Exception as e:
|