Skip to content

Commit

Permalink
Catch job cancellation exceptions
Browse files Browse the repository at this point in the history
ajhai committed Nov 8, 2024

Verified

This commit was signed with the committer’s verified signature.
ajhai Ajay Chintala
1 parent c134286 commit 77d14c9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion llmstack/sheets/apis.py
Original file line number Diff line number Diff line change
@@ -309,7 +309,11 @@ def cancel_run(self, request, sheet_uuid=None, run_id=None):

if run_id_in_sheet != run_id:
return DRFResponse(status=status.HTTP_400_BAD_REQUEST)
PromptlySheetAppExecuteJob.cancel(job_id)

try:
PromptlySheetAppExecuteJob.cancel(job_id)
except Exception as e:
logger.error(f"Error cancelling job {job_id}: {e}")

sheet.extra_data["running"] = False
sheet.extra_data["job_id"] = None

0 comments on commit 77d14c9

Please sign in to comment.