Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions state-manager/app/controller/get_runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,18 @@ async def get_run_status(run_id: str) -> RunStatusEnum:
return RunStatusEnum.PENDING

async def get_run_info(run: Run) -> RunListItem:

total_count = await State.find(State.run_id == run.run_id).count()

return RunListItem(
run_id=run.run_id,
graph_name=run.graph_name,
success_count=await State.find(State.run_id == run.run_id, In(State.status, [StateStatusEnum.SUCCESS, StateStatusEnum.PRUNED])).count(),
pending_count=await State.find(State.run_id == run.run_id, In(State.status, [StateStatusEnum.CREATED, StateStatusEnum.QUEUED, StateStatusEnum.EXECUTED])).count(),
errored_count=await State.find(State.run_id == run.run_id, In(State.status, [StateStatusEnum.ERRORED, StateStatusEnum.NEXT_CREATED_ERROR])).count(),
retried_count=await State.find(State.run_id == run.run_id, State.status == StateStatusEnum.RETRY_CREATED).count(),
Comment thread
NiveditJain marked this conversation as resolved.
Outdated
total_count=await State.find(State.run_id == run.run_id,).count(),
status=await get_run_status(run.run_id),
total_count=total_count,
status=await get_run_status(run.run_id) if total_count > 0 else RunStatusEnum.FAILED,
created_at=run.created_at
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
)
Comment thread
NiveditJain marked this conversation as resolved.
Outdated

Expand Down
3 changes: 2 additions & 1 deletion state-manager/app/controller/trigger_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ async def trigger_graph(namespace_name: str, graph_name: str, body: TriggerGraph
) for key, value in body.store.items()
]

await Store.insert_many(new_stores)
if len(new_stores) > 0:
Comment thread
NiveditJain marked this conversation as resolved.
await Store.insert_many(new_stores)

Comment thread
NiveditJain marked this conversation as resolved.
root = graph_template.get_root_node()

Expand Down
Loading