mirror of
https://github.com/Skyvern-AI/skyvern.git
synced 2025-09-11 16:04:36 +00:00
add Request context to async_executor (#709)
This commit is contained in:
parent
4a8b1473ec
commit
fd5fdb9d32
4 changed files with 47 additions and 3 deletions
|
@ -1,7 +1,7 @@
|
|||
import abc
|
||||
|
||||
import structlog
|
||||
from fastapi import BackgroundTasks
|
||||
from fastapi import BackgroundTasks, Request
|
||||
|
||||
from skyvern.exceptions import OrganizationNotFound
|
||||
from skyvern.forge import app
|
||||
|
@ -16,6 +16,7 @@ class AsyncExecutor(abc.ABC):
|
|||
@abc.abstractmethod
|
||||
async def execute_task(
|
||||
self,
|
||||
request: Request | None,
|
||||
background_tasks: BackgroundTasks,
|
||||
task_id: str,
|
||||
organization_id: str,
|
||||
|
@ -28,6 +29,7 @@ class AsyncExecutor(abc.ABC):
|
|||
@abc.abstractmethod
|
||||
async def execute_workflow(
|
||||
self,
|
||||
request: Request | None,
|
||||
background_tasks: BackgroundTasks,
|
||||
organization_id: str,
|
||||
workflow_id: str,
|
||||
|
@ -42,6 +44,7 @@ class AsyncExecutor(abc.ABC):
|
|||
class BackgroundTaskExecutor(AsyncExecutor):
|
||||
async def execute_task(
|
||||
self,
|
||||
request: Request | None,
|
||||
background_tasks: BackgroundTasks,
|
||||
task_id: str,
|
||||
organization_id: str,
|
||||
|
@ -83,6 +86,7 @@ class BackgroundTaskExecutor(AsyncExecutor):
|
|||
|
||||
async def execute_workflow(
|
||||
self,
|
||||
request: Request | None,
|
||||
background_tasks: BackgroundTasks,
|
||||
organization_id: str,
|
||||
workflow_id: str,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue