From db56b2eb95dc38c101acdab13cb497d24358142c Mon Sep 17 00:00:00 2001 From: arthurhuang Date: Fri, 3 Jan 2025 11:10:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8F=96=E6=B6=88signal()=E7=9A=84provi?= =?UTF-8?q?ding=5Fargs=E5=8F=82=E6=95=B0=E4=BC=A0=E5=85=A5=20#1464?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- itsm/trigger/signal/signals.py | 4 +- itsm/workflow/signals/__init__.py | 4 +- .../contrib/periodic_task/signals/__init__.py | 10 ++-- pipeline/core/flow/signals.py | 2 +- pipeline/core/signals/__init__.py | 2 +- pipeline/engine/signals/__init__.py | 46 ++++++++++++------- 6 files changed, 43 insertions(+), 25 deletions(-) diff --git a/itsm/trigger/signal/signals.py b/itsm/trigger/signal/signals.py index c88cd4d3f..020fe6c0e 100644 --- a/itsm/trigger/signal/signals.py +++ b/itsm/trigger/signal/signals.py @@ -31,5 +31,5 @@ # 统一用一个信号来接收,然后统一分配具体的事项 trigger_signal = TriggerSignal() -action_finish = Signal(providing_args=("action_id", "result", "error_message")) -post_action_finish = Signal(providing_args=("instance",)) +action_finish = Signal() # providing_args=("action_id", "result", "error_message") +post_action_finish = Signal() # providing_args=("instance",) diff --git a/itsm/workflow/signals/__init__.py b/itsm/workflow/signals/__init__.py index a13f844c5..a2f858ce4 100644 --- a/itsm/workflow/signals/__init__.py +++ b/itsm/workflow/signals/__init__.py @@ -25,5 +25,5 @@ from django.dispatch import Signal -state_created = Signal(providing_args=["flow_id", "state_id", "state_type"]) -state_deleted = Signal(providing_args=["flow_id", "state_id"]) +state_created = Signal() # providing_args=["flow_id", "state_id", "state_type"] +state_deleted = Signal() # providing_args=["flow_id", "state_id"] diff --git a/pipeline/contrib/periodic_task/signals/__init__.py b/pipeline/contrib/periodic_task/signals/__init__.py index bebb9add9..658418deb 100644 --- a/pipeline/contrib/periodic_task/signals/__init__.py +++ b/pipeline/contrib/periodic_task/signals/__init__.py @@ -13,6 +13,10 @@ from django.dispatch import Signal -pre_periodic_task_start = Signal(providing_args=["periodic_task", "pipeline_instance"]) -post_periodic_task_start = Signal(providing_args=["periodic_task", "pipeline_instance"]) -periodic_task_start_failed = Signal(providing_args=["periodic_task", "history"]) +pre_periodic_task_start = ( + Signal() +) # providing_args=["periodic_task", "pipeline_instance"] +post_periodic_task_start = ( + Signal() +) # providing_args=["periodic_task", "pipeline_instance"] +periodic_task_start_failed = Signal() # providing_args=["periodic_task", "history"] diff --git a/pipeline/core/flow/signals.py b/pipeline/core/flow/signals.py index 62dd35660..f63af1e0c 100644 --- a/pipeline/core/flow/signals.py +++ b/pipeline/core/flow/signals.py @@ -13,4 +13,4 @@ from django.dispatch import Signal -post_new_end_event_register = Signal(providing_args=["node_type", "node_cls"]) +post_new_end_event_register = Signal() # providing_args=["node_type", "node_cls"] diff --git a/pipeline/core/signals/__init__.py b/pipeline/core/signals/__init__.py index 291cc6621..7caa3b5bd 100644 --- a/pipeline/core/signals/__init__.py +++ b/pipeline/core/signals/__init__.py @@ -13,4 +13,4 @@ from django.dispatch import Signal -pre_variable_register = Signal(providing_args=["variable_code"]) +pre_variable_register = Signal() # providing_args=["variable_code"] diff --git a/pipeline/engine/signals/__init__.py b/pipeline/engine/signals/__init__.py index 9bb510f31..e2fa6e7d3 100644 --- a/pipeline/engine/signals/__init__.py +++ b/pipeline/engine/signals/__init__.py @@ -13,23 +13,37 @@ from django.dispatch import Signal -pipeline_ready = Signal(providing_args=["process_id"]) -pipeline_end = Signal(providing_args=["root_pipeline_id"]) -pipeline_revoke = Signal(providing_args=["root_pipeline_id"]) -child_process_ready = Signal(providing_args=["child_id"]) -process_ready = Signal(providing_args=["parent_id", "current_node_id", "call_from_child"]) -batch_process_ready = Signal(providing_args=["process_id_list", "pipeline_id"]) -wake_from_schedule = Signal(providing_args=["process_id, activity_id"]) -schedule_ready = Signal(providing_args=["schedule_id", "countdown", "process_id", "data_id"]) -process_unfreeze = Signal(providing_args=["process_id"]) +pipeline_ready = Signal() # providing_args=("process_id",) +pipeline_end = Signal() # providing_args=("root_pipeline_id",) +pipeline_revoke = Signal() # providing_args=("root_pipeline_id",) +child_process_ready = Signal() # providing_args=("child_id",) +process_ready = ( + Signal() +) # providing_args=("parent_id", "current_node_id", "call_from_child",) +batch_process_ready = Signal() # providing_args=("process_id_list", "pipeline_id",) +wake_from_schedule = Signal() # providing_args=("process_id", "activity_id",) +schedule_ready = ( + Signal() +) # providing_args=("schedule_id", "countdown", "process_id", "data_id",) +process_unfreeze = Signal() # providing_args=("process_id",) # activity failed signal -activity_failed = Signal(providing_args=["pipeline_id", "pipeline_activity_id", "subprocess_id_stack"]) +activity_failed = ( + Signal() +) # providing_args=("pipeline_id", "pipeline_activity_id", "subprocess_id_stack",) # signal for developer (do not use valve to pass them!) -service_schedule_fail = Signal(providing_args=["activity_shell", "schedule_service", "ex_data"]) -service_schedule_success = Signal(providing_args=["activity_shell", "schedule_service"]) -node_skip_call = Signal(providing_args=["process", "node"]) -node_retry_ready = Signal(providing_args=["process", "node"]) +service_schedule_fail = ( + Signal() +) # providing_args=("activity_shell", "schedule_service", "ex_data",) +service_schedule_success = ( + Signal() +) # providing_args=("activity_shell", "schedule_service",) +node_skip_call = Signal() # providing_args=("process", "node",) +node_retry_ready = Signal() # providing_args=("process", "node",) -service_activity_timeout_monitor_start = Signal(providing_args=["node_id", "version", "root_pipeline_id", "countdown"]) -service_activity_timeout_monitor_end = Signal(providing_args=["node_id", "version"]) +service_activity_timeout_monitor_start = ( + Signal() +) # providing_args=("node_id", "version", "root_pipeline_id", "countdown",) +service_activity_timeout_monitor_end = ( + Signal() +) # providing_args=("node_id", "version",)