Skip to content

Commit c13b530

Browse files
committed
Update prune_signal status check to validate against QUEUED state
- Modified the status check in the prune_signal function to ensure that the state must be QUEUED before proceeding with pruning, enhancing the validation logic and error handling for state management operations.
1 parent 74f51a6 commit c13b530

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

state-manager/app/controller/prune_signal.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ async def prune_signal(namespace_name: str, state_id: PydanticObjectId, body: Pr
1818
if not state:
1919
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="State not found")
2020

21-
if state.status != StateStatusEnum.CREATED:
22-
raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail="State is not created")
21+
if state.status != StateStatusEnum.QUEUED:
22+
raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail="State is not queued")
2323

2424
state.status = StateStatusEnum.PRUNED
2525
state.data = body.data

0 commit comments

Comments
 (0)