Skip to content

Conversation

@HynoR
Copy link
Contributor

@HynoR HynoR commented Jan 19, 2026

#11697

What this PR does / why we need it?

  • 远程同步的代码300多行,塞在一个闭包函数,闭包里很多变量只能在使用时建立。导致可读性和可维护性也很差
  • 拆分远程同步应用商店的逻辑到一个单独文件,为后续优化pr做准备,同时减少局部变量满天飞的情况
    优化下载 app 的图标和 compose 时,滥用 http.Client 临时创建导致不必要的开支问题。

Summary of your change

  • 重新整理任务里的一大段函数,将闭包函数转换成单体私有函数。不改变任何逻辑也没有添加其他代码。
  • 修改req_helper函数,新建 withClient方法,允许一个线程里复用创建的 http Client,避免每次http 请求都要通过req_helper创建一次 client, 之前在 appicon同步那个地方一口气会有超过 240 个 http client临时创建
  • 新建 tasklog 进度条格式,把最长时间的图标下载引入进度条打印,可以查看卡在哪里了
bbe18e58cad6299a793a4377d846953b

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.

HynoR added 3 commits January 19, 2026 16:21
- Introduced a new `syncAppStoreTask` function to handle the synchronization of applications from the AppStore.
- The function checks for updates, retrieves the application list, and manages the synchronization process, including downloading app icons and updating app details.
- Refactored the existing app synchronization logic from `SyncAppListFromRemote` into the new task for improved maintainability and clarity.
- Added logging for progress tracking during the synchronization process.
- Introduced `HandleRequestWithClient` function to allow custom HTTP clients for requests.
- Moved the transport loading logic into the new function for better separation of concerns.
- Updated `HandleRequest` to utilize the new function, enhancing flexibility in request handling.
- Replaced direct HTTP request handling with `HandleRequestWithClient` for downloading app icons and Docker Compose files.
- Removed unused variables and logging related to icon download updates for cleaner code.
- Improved error handling and logging for failed requests.
@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Jan 19, 2026

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.

Details

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-sigs/prow repository.

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Jan 19, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign wanghe-fit2cloud for approval. For more information see the Code Review Process.

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

Details 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

@HynoR HynoR marked this pull request as ready for review January 19, 2026 08:52
@HynoR
Copy link
Contributor Author

HynoR commented Jan 19, 2026

@zhengkunwang223 劳烦大佬 review :)

@zhengkunwang223 zhengkunwang223 merged commit 1025cd3 into 1Panel-dev:dev-v2 Jan 19, 2026
0 of 3 checks passed
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.

2 participants