Skip to content

Commit

Permalink
use request to fetch presigned-url
Browse files Browse the repository at this point in the history
  • Loading branch information
mwdchang committed Jan 30, 2024
1 parent a7d1725 commit 294473c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion service/utils/tds.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,9 @@ def attach_files(output: dict, job_id, status="complete"):
upload_url = f"{sim_results_url}/upload-url?filename={handle}"
upload_response = tds_session().get(upload_url)
presigned_upload_url = upload_response.json()["url"]

with open(location, "rb") as f:
upload_response = tds_session().put(presigned_upload_url, f)
upload_response = requests.put(presigned_upload_url, f)
if upload_response.status_code >= 300:
raise Exception(
(
Expand Down

0 comments on commit 294473c

Please sign in to comment.