Skip to content

Commit

Permalink
🔄 synced local 'skyvern/' with remote 'skyvern/'
Browse files Browse the repository at this point in the history
  • Loading branch information
ykeremy committed Apr 19, 2024
1 parent 393b3fb commit e84a881
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions skyvern/forge/sdk/db/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,29 @@ async def update_step(
LOG.error("UnexpectedError", exc_info=True)
raise

async def clear_task_failure_reason(self, task_id: str, organization_id: str) -> Task:
try:
async with self.Session() as session:
if task := (
await session.scalars(
select(TaskModel).filter_by(task_id=task_id).filter_by(organization_id=organization_id)
)
).first():
task.failure_reason = None
await session.commit()
return convert_to_task(task, debug_enabled=self.debug_enabled)
else:
raise NotFoundError("Task not found")
except SQLAlchemyError:
LOG.error("SQLAlchemyError", exc_info=True)
raise
except NotFoundError:
LOG.error("NotFoundError", exc_info=True)
raise
except Exception:
LOG.error("UnexpectedError", exc_info=True)
raise

async def update_task(
self,
task_id: str,
Expand Down

0 comments on commit e84a881

Please sign in to comment.