Files
orbit/weave/model/pending_advance.go

27 lines
1.0 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package model
import (
"time"
core "git.yuntuo.hk/k2safe/orbit/model"
)
// PendingAdvance 保存根步骤续接或等待时钟检查点,避免仅依赖内存唤醒。
// 对应表 weave_pending_advances;这是服务端持久化模型,不直接作为 API 响应。
type PendingAdvance struct {
// Record 包含命名空间、记录标识、并发版本和 UTC 时间。
core.Record
// WorkflowID 所属流程实例标识。
WorkflowID core.ID `db:"workflow_id"`
// StepID 所属逻辑步骤标识。
StepID core.ID `db:"step_id"`
// ExpectedStepRevision 恢复推进时要求的步骤版本,避免使用过期检查点。
ExpectedStepRevision uint64 `db:"expected_step_revision"`
// Checkpoint 版本化 JSON;ROOT用于分批/暂停续接,TIMER/POLL另固定激活ID以隔离旧唤醒。
Checkpoint core.JSON `db:"checkpoint"`
// AvailableAt 最早可被领取或处理的时间,统一 UTC。
AvailableAt time.Time `db:"available_at"`
}
func (PendingAdvance) TableName() string { return "weave_pending_advances" }