Omkar008 commited on
Commit
22419aa
·
verified ·
1 Parent(s): 8aa59e6

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +19 -16
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
- dataset = await request.json()
 
 
 
 
 
 
 
 
28
 
29
- # Create initial batch job record
30
- save_data = {
31
- 'batch_job_id': f"batch_{datetime.utcnow().strftime('%Y%m%d_%H%M%S')}",
32
- "batch_job_status": False,
33
- "created_at": datetime.utcnow().isoformat()
34
- }
35
 
36
- response = (
37
- supabase.table("batch_processing_details")
38
- .insert(save_data)
39
- .execute()
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: