handle multiple jobs in a single call

This commit is contained in:
Daniel Roth 2026-03-24 09:17:05 +00:00
parent 54c05096e8
commit 53502c28a8

View file

@ -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")