Skip to content

Commit

Permalink
fix cancel
Browse files Browse the repository at this point in the history
  • Loading branch information
genekogan committed Jan 8, 2025
1 parent f426e03 commit c904cc7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion eve/api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@ def fastapi_app():

@app.function(
image=image,
schedule=modal.Period(minutes=15)
schedule=modal.Period(minutes=15),
timeout=3600
)
async def postprocessing():
try:
Expand Down
2 changes: 1 addition & 1 deletion eve/api/api_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class TaskRequest(BaseModel):

class CancelRequest(BaseModel):
task_id: str
user_id: str
user: str


class UpdateConfig(BaseModel):
Expand Down
2 changes: 1 addition & 1 deletion eve/api/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ async def handle_create(request: TaskRequest):
@handle_errors
async def handle_cancel(request: CancelRequest):
task = Task.from_mongo(request.task_id)
if str(task.user) != request.user_id:
if str(task.user) != request.user:
raise APIError(
"Unauthorized: Task user does not match user_id", status_code=403
)
Expand Down

0 comments on commit c904cc7

Please sign in to comment.