mirror of
https://github.com/langgenius/dify.git
synced 2026-05-03 00:48:04 +08:00
Change the is_resumption field in WorkflowStarted event into reason (vibe-kanban 19ac040e)
Reason should be an enumeration with only one member `resumption` currently. Please update these part of events: - Graph / Engine Event (GraphRunStartedEvent) - Queue event (QueueWorkflowStartedEvent) - SSE response event (WorkflowStartStreamResponse) Besides, you should remove the `is_resumption` flag for `node_started` events; including: - Queue Event (`QueueNodeStartedEvent`) - SSE Event (`NodeStartStreamResponse`) - Node event (`NodeRunStartedEvent`) After finishing the changes above, adjust related tests. You should run the affected tests and ensure they can pass. (You should use `uv run pytest` to run tests)
This commit is contained in:
@ -13,6 +13,7 @@ from typing import TYPE_CHECKING, cast, final
|
||||
|
||||
from flask import Flask, current_app
|
||||
|
||||
from core.workflow.entities.workflow_start_reason import WorkflowStartReason
|
||||
from core.workflow.enums import NodeExecutionType
|
||||
from core.workflow.graph import Graph
|
||||
from core.workflow.graph_events import (
|
||||
@ -235,7 +236,9 @@ class GraphEngine:
|
||||
self._graph_execution.paused = False
|
||||
self._graph_execution.pause_reasons = []
|
||||
|
||||
start_event = GraphRunStartedEvent(is_resumption=is_resume)
|
||||
start_event = GraphRunStartedEvent(
|
||||
reason=WorkflowStartReason.RESUMPTION if is_resume else WorkflowStartReason.INITIAL,
|
||||
)
|
||||
self._event_manager.notify_layers(start_event)
|
||||
yield start_event
|
||||
|
||||
|
||||
Reference in New Issue
Block a user