mirror of
https://github.com/langgenius/dify.git
synced 2026-02-22 19:15:47 +08:00
feat(trigger): enhance trigger event handling and introduce new debug event polling
- Refactored the `DraftWorkflowTriggerNodeApi` and related services to utilize the new `TriggerService` for polling debug events, improving modularity and clarity. - Added `poll_debug_event` methods in `TriggerService`, `ScheduleService`, and `WebhookService` to streamline event handling for different trigger types. - Introduced `ScheduleDebugEvent` and updated `PluginTriggerDebugEvent` to include a more structured approach for event data. - Enhanced the `invoke_trigger_event` method to improve error handling and data validation during trigger invocations. - Updated frontend API calls to align with the new event structure, removing deprecated parameters for cleaner integration.
This commit is contained in:
@ -140,16 +140,17 @@ def dispatch_triggered_workflows_async(
|
||||
try:
|
||||
for event_name in events:
|
||||
pool_key: str = PluginTriggerDebugEvent.build_pool_key(
|
||||
name=event_name,
|
||||
tenant_id=subscription.tenant_id,
|
||||
subscription_id=subscription_id,
|
||||
event_name=event_name,
|
||||
provider_id=provider_id,
|
||||
)
|
||||
event = PluginTriggerDebugEvent(
|
||||
provider_id=provider_id,
|
||||
subscription_id=subscription_id,
|
||||
request_id=request_id,
|
||||
timestamp=timestamp,
|
||||
event_name=event_name,
|
||||
name=event_name,
|
||||
)
|
||||
debug_dispatched += TriggerDebugService.dispatch(
|
||||
tenant_id=subscription.tenant_id,
|
||||
|
||||
Reference in New Issue
Block a user