m8chaa commited on
Commit
07ba5c4
·
verified ·
1 Parent(s): 61ab5e9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -95,7 +95,7 @@ async def record_failure(s3_original_url, failed_task, sheetID):
95
 
96
  # post the processed image to google apps script
97
  async def post_to_google_apps_script(appsScriptsURL, body, s3_orginal_url):
98
- async with httpx.AsyncClient(timeout=300.0, follow_redirects=True, timeout=timeout) as client:
99
  response = await client.post(appsScriptsURL, json=body)
100
  if response.status_code != 200:
101
  logging.error(f"Unexpected response from Google Apps Script API: {response.status_code} - {response.text}")
@@ -187,7 +187,7 @@ async def detect_receipts(image_contents, s3_orginal_url, sheetID):
187
  dezgo_headers = {
188
  'X-Dezgo-Key': dezgo_api_key,
189
  }
190
- async with httpx.AsyncClient(timeout=300.0, timeout=timeout) as client:
191
  response = await client.post('https://api.dezgo.com/remove-background', headers=dezgo_headers, files=files)
192
  # if successful, pass the masked image to cutting_image function
193
  if response.status_code == 200:
 
95
 
96
  # post the processed image to google apps script
97
  async def post_to_google_apps_script(appsScriptsURL, body, s3_orginal_url):
98
+ async with httpx.AsyncClient(timeout=300.0, follow_redirects=True) as client:
99
  response = await client.post(appsScriptsURL, json=body)
100
  if response.status_code != 200:
101
  logging.error(f"Unexpected response from Google Apps Script API: {response.status_code} - {response.text}")
 
187
  dezgo_headers = {
188
  'X-Dezgo-Key': dezgo_api_key,
189
  }
190
+ async with httpx.AsyncClient(timeout=timeout) as client:
191
  response = await client.post('https://api.dezgo.com/remove-background', headers=dezgo_headers, files=files)
192
  # if successful, pass the masked image to cutting_image function
193
  if response.status_code == 200: