mirror of
https://github.com/langgenius/dify.git
synced 2026-05-04 01:18:05 +08:00
refactor: improve trigger metadata handling and streamline workflow service
- Updated ScheduleTriggerDebugEventPoller to include an empty files list in workflow_args. - Enhanced WorkflowAppService to handle trigger metadata more effectively, including a new method for processing metadata and removing the deprecated _safe_json_loads function. - Adjusted PluginTriggerMetadata to use icon_filename and icon_dark_filename for better clarity. - Simplified async workflow task parameters by changing triggered_from to trigger_from for consistency.
This commit is contained in:
@ -1,7 +1,5 @@
|
||||
import logging
|
||||
import time
|
||||
from datetime import UTC, datetime
|
||||
from zoneinfo import ZoneInfo
|
||||
|
||||
from celery import shared_task
|
||||
from sqlalchemy.orm import sessionmaker
|
||||
@ -47,10 +45,7 @@ def run_schedule_trigger(schedule_id: str) -> None:
|
||||
raise TenantOwnerNotFoundError(f"No owner or admin found for tenant {schedule.tenant_id}")
|
||||
|
||||
try:
|
||||
current_utc = datetime.now(UTC)
|
||||
schedule_tz = ZoneInfo(schedule.timezone) if schedule.timezone else UTC
|
||||
current_in_tz = current_utc.astimezone(schedule_tz)
|
||||
inputs = {"current_time": current_in_tz.isoformat()}
|
||||
inputs = {}
|
||||
|
||||
# Production dispatch: Trigger the workflow normally
|
||||
response = AsyncWorkflowService.trigger_workflow_async(
|
||||
|
||||
Reference in New Issue
Block a user