feat: persist workflow timers and bounded poll rounds

This commit is contained in:
2026-09-18 03:03:31 +08:00
parent f602a5ee05
commit e2baffbe37
21 changed files with 1201 additions and 28 deletions

View File

@@ -6,7 +6,7 @@ import (
core "git.yuntuo.hk/k2safe/orbit/model"
)
// PendingAdvance 表示暂停或分批推进后的续接检查点,避免仅依赖内存唤醒。
// PendingAdvance 保存根步骤续接或等待时钟检查点,避免仅依赖内存唤醒。
// 对应表 weave_pending_advances;这是服务端持久化模型,不直接作为 API 响应。
type PendingAdvance struct {
// Record 包含命名空间、记录标识、并发版本和 UTC 时间。
@@ -17,7 +17,7 @@ type PendingAdvance struct {
StepID core.ID `db:"step_id"`
// ExpectedStepRevision 恢复推进时要求的步骤版本,避免使用过期检查点。
ExpectedStepRevision uint64 `db:"expected_step_revision"`
// Checkpoint 分批或暂停后继续推进所需的持久化 JSON 检查点。
// Checkpoint 版本化 JSON;ROOT用于分批/暂停续接,TIMER/POLL另固定激活ID以隔离旧唤醒。
Checkpoint core.JSON `db:"checkpoint"`
// AvailableAt 最早可被领取或处理的时间,统一 UTC。
AvailableAt time.Time `db:"available_at"`