You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(jobs): add persistent job queue with retries, cancellation and restart recovery #67
Activity
feat(jobs): 持久化作业队列第一批 —— 并发键、重试退避、超时、取消(#67)
Merge pull request #84 from Antruly/feat/job-queue
feat(db): 作业队列的数据库持久化适配器(#67 剩余)
feat(jobs): 作业队列的异步 handler(#67 收尾)
Antruly commentedon Nov 23, 2026
#67 的能力已全部落地并合入
master(1.11.0-dev),CI 在f736cac/203daa9/0c0a12a上各平台全绿(Linux 的 zlib-off 格在 0c0a12a 上因 FetchContent 拉 llhttp 被 GitHub 403,与代码无关,已单独重跑)。持久化后端:
uvcpp_db_job_store(#include <db/uvcpp_db_job_store.h>,需要UVCPP_ENABLE_DB=ON)$nvs?)与 upsert 语法;open()建表;表名白名单防注入。db_job_store_func:直接 save/load/erase/upsert;队列跑完后记录仍在;用新的 store + 新的 queue 打开同一个库,把 PENDING 捡起来执行成功(跨进程恢复闭环)。CI 的 db-servers 格 SQLite 关、MySQL/PG 开,三种方言都真跑过。异步 handler:
register_async_handler(type, handler)done(ok, err)结束尝试;ctx是shared_ptr,可被异步回调捕获;同一 type 同步/异步都有时异步优先。ctx->cancelled()),done只认第一次。用例job_queue_func的异步组:成功、失败重试、运行中取消、超时。验收对照:进程重启恢复 ✅、
concurrency_key串行 ✅、重试/退避 ✅、取消 ✅、队列满拒绝 ✅、不阻塞事件循环(同步 handler 在工作池、异步在 loop)✅、状态与 store 一致 ✅。关闭本 issue。