Skip to content

Commit

Permalink
make get signed_url requests async in get_agent_task_step_artifacts api
Browse files Browse the repository at this point in the history
  • Loading branch information
wintonzheng committed Apr 15, 2024
1 parent 6b7b9ab commit 74c4f43
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions skyvern/forge/sdk/routes/agent_protocol.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import asyncio
from typing import Annotated, Any

import structlog
Expand Down Expand Up @@ -400,8 +401,9 @@ async def get_agent_task_step_artifacts(
organization_id=current_org.organization_id,
)
if SettingsManager.get_settings().ENV != "local":
for artifact in artifacts:
artifact.signed_url = await app.ARTIFACT_MANAGER.get_share_link(artifact)
signed_urls = await asyncio.gather(*[app.ARTIFACT_MANAGER.get_share_link(artifact) for artifact in artifacts])
for i, artifact in enumerate(artifacts):
artifact.signed_url = signed_urls[i]
return ORJSONResponse([artifact.model_dump() for artifact in artifacts])


Expand Down

0 comments on commit 74c4f43

Please sign in to comment.