27 lines
1.0 KiB
Go
27 lines
1.0 KiB
Go
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/SIGNAL/POLL另固定激活ID以隔离旧唤醒。
|
||
Checkpoint core.JSON `db:"checkpoint"`
|
||
// AvailableAt 最早可被领取或处理的时间,统一 UTC。
|
||
AvailableAt time.Time `db:"available_at"`
|
||
}
|
||
|
||
func (PendingAdvance) TableName() string { return "weave_pending_advances" }
|