mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
handle multiple jobs in a single call
This commit is contained in:
parent
54c05096e8
commit
53502c28a8
1 changed files with 11 additions and 2 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import time
|
||||
from typing import Any, List, Mapping
|
||||
|
||||
from backend.pashub_fetcher.cotality_client import CotalityClient
|
||||
|
|
@ -20,7 +21,15 @@ def handler(event: Mapping[str, Any], context: Any) -> None:
|
|||
raise
|
||||
|
||||
client = CotalityClient(token=token)
|
||||
job_id = "5abf6e27-e4c4-4ba8-b69d-9e34939e0002" # TODO: get from request body
|
||||
|
||||
saved_files: List[str] = client.get_core_envidence_files_by_job_id(job_id)
|
||||
jobs = [
|
||||
"5abf6e27-e4c4-4ba8-b69d-9e34939e0002",
|
||||
"047f4455-85e2-4293-97b1-6b460137d33e",
|
||||
] # TODO: get these from request body
|
||||
|
||||
saved_files: List[str] = []
|
||||
for job_id in jobs:
|
||||
saved_files.extend(client.get_core_envidence_files_by_job_id(job_id))
|
||||
time.sleep(10) # Simulate manual download
|
||||
|
||||
print(f"saved {len(saved_files)} files")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue