🐛 fix(chat.py): change BuildStatus.IN_PROGRESS to BuildStatus.STARTED for better clarity
🐛 fix(chat.py): fix incorrect key used to retrieve graph_data from flow_data_store
The BuildStatus.IN_PROGRESS constant is changed to BuildStatus.STARTED to provide a more accurate representation of the flow status. Additionally, the incorrect key "data" is replaced with "graph_data" when retrieving the graph data from the flow_data_store dictionary.
This commit is contained in:
parent
3faf5f5b96
commit
f1e2bbb69c
2 changed files with 4 additions and 2 deletions
|
|
@ -47,7 +47,7 @@ async def init_build(graph_data: dict, flow_id: str):
|
|||
logger.debug(f"Deleted flow {flow_id} from cache")
|
||||
flow_data_store[flow_id] = {
|
||||
"graph_data": graph_data,
|
||||
"status": BuildStatus.IN_PROGRESS,
|
||||
"status": BuildStatus.STARTED,
|
||||
}
|
||||
|
||||
return InitResponse(flowId=flow_id)
|
||||
|
|
@ -91,7 +91,7 @@ async def stream_build(flow_id: str):
|
|||
yield str(StreamData(event="error", data={"error": error_message}))
|
||||
return
|
||||
|
||||
graph_data = flow_data_store[flow_id].get("data")
|
||||
graph_data = flow_data_store[flow_id].get("graph_data")
|
||||
|
||||
if not graph_data:
|
||||
error_message = "No data provided"
|
||||
|
|
@ -109,6 +109,7 @@ async def stream_build(flow_id: str):
|
|||
return
|
||||
|
||||
number_of_nodes = len(graph.nodes)
|
||||
flow_data_store[flow_id]["status"] = BuildStatus.IN_PROGRESS
|
||||
for i, vertex in enumerate(graph.generator_build(), 1):
|
||||
try:
|
||||
log_dict = {
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ class BuildStatus(Enum):
|
|||
|
||||
SUCCESS = "success"
|
||||
FAILURE = "failure"
|
||||
STARTED = "started"
|
||||
IN_PROGRESS = "in_progress"
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue