Skip to content

Commit

Permalink
feat: 适配GSE单次执行进程 (closed #2078)
Browse files Browse the repository at this point in the history
  • Loading branch information
wyyalt committed Mar 26, 2024
1 parent a993187 commit 2bb6425
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions apps/backend/components/collections/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
from apps.utils.batch_request import request_multi_thread
from apps.utils.files import PathHandler
from common.api import JobApi
from env.constants import GseVersion
from pipeline.component_framework.component import Component
from pipeline.core.flow import Service, StaticIntervalGenerator

Expand Down Expand Up @@ -1152,6 +1153,7 @@ def request_gse_or_finish_schedule(self, proc_operate_req: List, data, common_da

def _execute(self, data, parent_data, common_data: PluginCommonData):
op_type = data.get_one_of_inputs("op_type")
gse_version = data.get_one_of_inputs("meta", {}).get("GSE_VERSION")
policy_step_adapter = common_data.policy_step_adapter
process_statuses = common_data.process_statuses
plugin = policy_step_adapter.plugin_desc
Expand Down Expand Up @@ -1194,8 +1196,8 @@ def _execute(self, data, parent_data, common_data: PluginCommonData):
"control": gse_control,
"resource": host_id__resource_policy_map[bk_host_id]["resource"],
"alive_monitor_policy": {
# 托管类型,0为周期执行进程,1为常驻进程,2为单次执行进程,这里仅需使用常驻进程
"auto_type": 1,
# 托管类型,0为周期执行进程,1为常驻进程,2为单次执行进程, 1.0沿用1
"auto_type": plugin.auto_type if gse_version == GseVersion.V2.value else 1,
"start_check_secs": 9,
},
},
Expand Down

0 comments on commit 2bb6425

Please sign in to comment.