sycommon-python-lib 0.2.12a6__py3-none-any.whl → 0.2.12a7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sycommon/devchat/handler.py +19 -0
- {sycommon_python_lib-0.2.12a6.dist-info → sycommon_python_lib-0.2.12a7.dist-info}/METADATA +1 -1
- {sycommon_python_lib-0.2.12a6.dist-info → sycommon_python_lib-0.2.12a7.dist-info}/RECORD +6 -6
- {sycommon_python_lib-0.2.12a6.dist-info → sycommon_python_lib-0.2.12a7.dist-info}/WHEEL +0 -0
- {sycommon_python_lib-0.2.12a6.dist-info → sycommon_python_lib-0.2.12a7.dist-info}/entry_points.txt +0 -0
- {sycommon_python_lib-0.2.12a6.dist-info → sycommon_python_lib-0.2.12a7.dist-info}/top_level.txt +0 -0
sycommon/devchat/handler.py
CHANGED
|
@@ -645,6 +645,25 @@ def setup_devchat_handler(app: FastAPI, config: Optional[dict] = None) -> FastAP
|
|
|
645
645
|
if n:
|
|
646
646
|
SYLogger.info(f"[Devchat] 启动恢复:{n} 条中断任务归为 error")
|
|
647
647
|
|
|
648
|
+
# 自动恢复:重启时库里还有 queued 存量 → 立即接力队首开跑(否则队列
|
|
649
|
+
# 要等下一条新消息进来才动,用户看到的就是「没有自动恢复」)。
|
|
650
|
+
# 与 Go 版 resumeQueued 同语义:等价于把 promote_next_queued 提前到
|
|
651
|
+
# 挂载时跑一次。挂载可能发生在事件循环起来之前 — 用 app startup
|
|
652
|
+
# 事件驱动,保证 _drive_claude 的 create_task 有活着的 loop。
|
|
653
|
+
with contextlib.suppress(Exception):
|
|
654
|
+
pending = 0
|
|
655
|
+
if st.tasks is not None:
|
|
656
|
+
pending = 1 if st.tasks.oldest_queued() is not None else 0
|
|
657
|
+
if pending:
|
|
658
|
+
SYLogger.info("[Devchat] 自动恢复:发现排队任务,服务就绪后接力启动")
|
|
659
|
+
|
|
660
|
+
async def _resume_queue() -> None:
|
|
661
|
+
await _promote_next_queued(st)
|
|
662
|
+
|
|
663
|
+
@app.on_event("startup")
|
|
664
|
+
async def _resume_on_startup() -> None: # noqa: W0212
|
|
665
|
+
asyncio.ensure_future(_resume_queue())
|
|
666
|
+
|
|
648
667
|
# 服务自身地址(app.yaml 的 Host/Port):审批 MCP 回调的兜底 —
|
|
649
668
|
# 面板请求未探测到真实 Host 前按它回环调用(与 Go 版同语义)。
|
|
650
669
|
# 配置源:宿主 Services 已加载时读其 _config dict(app.yaml 顶层键);
|
|
@@ -217,7 +217,7 @@ sycommon/database/txnref.py,sha256=sOFp85PlanCA0oryVpHu53JbM0aSHAVkELWgEJKalLI,7
|
|
|
217
217
|
sycommon/devchat/__init__.py,sha256=Z2BgzDKrp_mR165d3a1kftP8lf1-WKz_5xuZMFXR-iw,2288
|
|
218
218
|
sycommon/devchat/_page.html,sha256=CxzEhC867FawFjlEKk6uCChEX3EoRP4jwdn09C_MdaU,29126
|
|
219
219
|
sycommon/devchat/_page.py,sha256=JzTX7Wv_4-nJky7wg5E44yftSQYvC9L9_YsQzNnaWhI,406
|
|
220
|
-
sycommon/devchat/handler.py,sha256=
|
|
220
|
+
sycommon/devchat/handler.py,sha256=4R0jpsLbSuQ1uevLJYRY_iYCnvJh3Q4jtYPltqXNV-k,48383
|
|
221
221
|
sycommon/devchat/login.py,sha256=TF57n0iP3jHgiYs4NdDDgAXlGJNtiKcW8haw9Rd9Jjo,7701
|
|
222
222
|
sycommon/devchat/store.py,sha256=iAxCJs5jrNbRDCVL4i0QnbEAUGLXtJumf8YsBGwfBe0,4047
|
|
223
223
|
sycommon/devchat/tasks.py,sha256=ijGHe2gyBfEZ11ylqvRihQDtbF2ugchQ6AzdyNCbD_0,19080
|
|
@@ -403,8 +403,8 @@ sycommon/tools/usercache.py,sha256=Zu2oiXISUOojleEYCAS9t06ZzgWSNHCIhCjv4yTtkRw,4
|
|
|
403
403
|
sycommon/xxljob/__init__.py,sha256=7eoBlQxv-B39IfRSCY2bkqdGYs1QRe1umAWd88VMEEM,86
|
|
404
404
|
sycommon/xxljob/sharding.py,sha256=LJ0tle7qSUS32S5ntjzri1aOcPzwL5CFde3W4Rf1AUE,2560
|
|
405
405
|
sycommon/xxljob/xxljob_service.py,sha256=1yifwIBNGsCIxLnQjHKiBlbsigc_zvPH-dMTZcNxe-Q,7649
|
|
406
|
-
sycommon_python_lib-0.2.
|
|
407
|
-
sycommon_python_lib-0.2.
|
|
408
|
-
sycommon_python_lib-0.2.
|
|
409
|
-
sycommon_python_lib-0.2.
|
|
410
|
-
sycommon_python_lib-0.2.
|
|
406
|
+
sycommon_python_lib-0.2.12a7.dist-info/METADATA,sha256=9DF2V6U-xuavt0dNK6KVnqNvucB3zMa7szAWJp0MNiY,8028
|
|
407
|
+
sycommon_python_lib-0.2.12a7.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
408
|
+
sycommon_python_lib-0.2.12a7.dist-info/entry_points.txt,sha256=gsR4SssKxDWjRU8ggidzNcdMXDPRSKRS7UaGyNP84Qg,92
|
|
409
|
+
sycommon_python_lib-0.2.12a7.dist-info/top_level.txt,sha256=RgphKrg7nJyZ7irJqbxFr-5H2LUYTvI7ivoWZH2hcD0,29
|
|
410
|
+
sycommon_python_lib-0.2.12a7.dist-info/RECORD,,
|
|
File without changes
|
{sycommon_python_lib-0.2.12a6.dist-info → sycommon_python_lib-0.2.12a7.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{sycommon_python_lib-0.2.12a6.dist-info → sycommon_python_lib-0.2.12a7.dist-info}/top_level.txt
RENAMED
|
File without changes
|