Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make get signed_url requests async in get_agent_task_step_artifacts api #192

Merged
merged 1 commit into from
Apr 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading