Skip to content

Commit

Permalink
feat: 优化进程启动时间为可配置项 (closed TencentBlueKing#2178)
Browse files Browse the repository at this point in the history
  • Loading branch information
Huayeaaa committed May 7, 2024
1 parent 1210116 commit 5f8e05b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion apps/backend/components/collections/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -1170,6 +1170,9 @@ def _execute(self, data, parent_data, common_data: PluginCommonData):

host_id__resource_policy_map = self.get_resource_policy(common_data.bk_host_ids, plugin.name)
proc_operate_req = []
start_check_secs = models.GlobalSettings.get_config(
models.GlobalSettings.KeyEnum.PLUGIN_PROC_START_CHECK_SECS.value, default=9
)
for process_status in process_statuses:
bk_host_id = process_status.bk_host_id
host = host_id_obj_map.get(bk_host_id)
Expand Down Expand Up @@ -1206,7 +1209,7 @@ def _execute(self, data, parent_data, common_data: PluginCommonData):
"alive_monitor_policy": {
# 托管类型,0为周期执行进程,1为常驻进程,2为单次执行进程, 1.0沿用1
"auto_type": plugin.auto_type if gse_version == GseVersion.V2.value else 1,
"start_check_secs": 9,
"start_check_secs": start_check_secs,
},
},
}
Expand Down
2 changes: 2 additions & 0 deletions apps/node_man/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ class KeyEnum(Enum):
SUBSCRIPTION_UPDATE_TASK_QUEUE = "SUBSCRIPTION_UPDATE_TASK_QUEUE"
# JOB任务策略
JOB_TASK_POLICY = "JOB_TASK_POLICY"
# 重启插件进程启动检查时间
PLUGIN_PROC_START_CHECK_SECS = "PLUGIN_PROC_START_CHECK_SECS"

key = models.CharField(_("键"), max_length=255, db_index=True, primary_key=True)
v_json = JSONField(_("值"))
Expand Down

0 comments on commit 5f8e05b

Please sign in to comment.