Compare commits

...

4 Commits

Author SHA1 Message Date
molanp
3f4b3a58b9
Merge d32a6fbdd4 into 977f0b13b3 2025-08-12 10:43:35 +08:00
molanp
977f0b13b3
fix(zhenxun): 修复 HTTP 客户端初始化逻辑错误 (#2014)
Some checks failed
检查bot是否运行正常 / bot check (push) Has been cancelled
CodeQL Code Security Analysis / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Has been cancelled
CodeQL Code Security Analysis / Analyze (${{ matrix.language }}) (none, python) (push) Has been cancelled
Sequential Lint and Type Check / ruff-call (push) Has been cancelled
Release Drafter / Update Release Draft (push) Has been cancelled
Force Sync to Aliyun / sync (push) Has been cancelled
Update Version / update-version (push) Has been cancelled
Sequential Lint and Type Check / pyright-call (push) Has been cancelled
- 将 httpx.AsyncClient 实例化逻辑封装到 get_async_client 函数中
- 统一全局客户端和测试环境客户端的创建方式
- 提高代码复用性和可维护性
2025-08-11 10:18:15 +08:00
molanp
2fed781350
fix(scheduler_admin): 修复定时任务列表页码显示逻辑 (#2016)
* fix(scheduler_admin): 修复定时任务列表页码显示逻辑

- 在格式化定时任务列表图像时,添加对当前页码的可用性判断
- 如果页码不可用,则将当前页码默认设置为 1,避免显示错误的页码信息

* 🚨 auto fix by pre-commit hooks

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-08-11 10:15:31 +08:00
molanp
6d1789bbee
fix(zhenxun): 修正插件更新逻辑 (#2017)
- 将循环遍历的变量从 plugin_list 改为 all_plugin_list,以确保尝试更新所有插件
- 优化了插件更新日志的输出格式
2025-08-11 10:14:41 +08:00
3 changed files with 6 additions and 4 deletions

View File

@ -416,7 +416,7 @@ class StoreManager:
update_success_list = []
result = "--已更新{}个插件 {}个失败 {}个成功--"
logger.info(f"尝试更新全部插件 {plugin_name_list}", LOG_COMMAND)
for plugin_info in plugin_list:
for plugin_info in all_plugin_list:
try:
db_plugin_list = await cls.get_loaded_plugins("module", "version")
suc_plugin = {p[0]: (p[1] or "Unknown") for p in db_plugin_list}

View File

@ -76,7 +76,9 @@ async def handle_view(
await schedule_cmd.finish("没有找到任何相关的定时任务。")
img = await presenters.format_schedule_list_as_image(
schedules=schedules, title=title, current_page=page.result
schedules=schedules,
title=title,
current_page=page.result if page.available else 1,
)
await MessageUtils.build_message(img).send(reply_to=True)

View File

@ -61,7 +61,7 @@ async def _():
"将默认使用新版 'proxy' 参数语法。"
)
_client = httpx.AsyncClient(
_client = get_async_client(
headers=get_user_agent(),
follow_redirects=True,
**client_kwargs,
@ -90,7 +90,7 @@ def get_client() -> AsyncClient:
raise RuntimeError("全局 httpx.AsyncClient 未初始化,请检查启动流程。")
# 在测试环境中创建临时客户端
logger.warning("在测试环境中创建临时HTTP客户端", "HTTPClient")
_client = httpx.AsyncClient(
_client = get_async_client(
headers=get_user_agent(),
follow_redirects=True,
)