mirror of
https://github.com/langgenius/dify.git
synced 2026-05-04 01:18:05 +08:00
fix(trigger): enhance error handling and refactor end user creation in trigger workflows
- Improved error handling in `TriggerSubscriptionListApi` to return a 404 response for ValueErrors. - Refactored end user creation logic in `service_api/wraps.py` to use `get_or_create_end_user` for better clarity and consistency. - Introduced a new method `create_end_user_batch` for batch creation of end users, optimizing database interactions. - Updated various trigger-related services to utilize the new end user handling, ensuring proper user context during trigger dispatching.
This commit is contained in:
@ -1114,7 +1114,10 @@ class DraftWorkflowTriggerRunAllApi(Resource):
|
||||
|
||||
try:
|
||||
trigger_debug_event: TriggerDebugEvent | None = select_trigger_debug_events(
|
||||
draft_workflow=draft_workflow, app_model=app_model, user_id=current_user.id, node_ids=node_ids
|
||||
draft_workflow=draft_workflow,
|
||||
app_model=app_model,
|
||||
user_id=current_user.id,
|
||||
node_ids=node_ids,
|
||||
)
|
||||
except ValueError as e:
|
||||
raise e
|
||||
|
||||
Reference in New Issue
Block a user