Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 优化systemctl中判断service文件是否存在的函数 #2615

Merged
merged 1 commit into from
Oct 23, 2023

Conversation

igophper
Copy link
Contributor

What this PR does / why we need it?

我发现在我的机器上,当点击主机->进程守护时,页面加载并不是很快,需要等待3秒左右的服务器返回时间,因为调用了systemctl 判断service文件是否存在的函数导致的。我想要减少等待。SSH管理的配置加载也因为这个需要等待1秒左右。优化后在我的机器上等待时间变为了毫秒。

Summary of your change

优化systemctl中判断service文件是否存在的函数
将原先列出文件的命令list-unit-files改为is-enabled进行判断

Please indicate you've done the following:

  • Made sure tests are passing and test coverage is added if needed.
  • Made sure commit message follow the rule of Conventional Commits specification.
  • Considered the docs impact and opened a new docs issue or PR with docs changes if needed.

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Oct 20, 2023

@igophper: Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Oct 20, 2023

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign ssongliu after the PR has been reviewed.
You can assign the PR to them by writing /assign @ssongliu in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@igophper igophper changed the title opt:优化systemctl中判断service文件是否存在的函数 feat: 优化systemctl中判断service文件是否存在的函数 Oct 20, 2023
@wanghe-fit2cloud
Copy link
Member

感谢您为 1Panel 项目的代码贡献。

@zhengkunwang223 zhengkunwang223 merged commit 523f1ea into 1Panel-dev:dev Oct 23, 2023
1 check was pending
@igophper igophper deleted the perf/systemctl_exist_func branch November 22, 2023 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants