feat: persist workflow signals and arbitrate poll completion

This commit is contained in:
2026-09-18 03:52:50 +08:00
parent e2baffbe37
commit 7d5ebfcb09
34 changed files with 1958 additions and 113 deletions

View File

@@ -11,8 +11,8 @@ import (
weave "git.yuntuo.hk/k2safe/orbit/weave/model"
)
// lockWorkflowGraph 只由内部运行器调用。身份→应用额度→排序队列→实例→门控,
// 不用启动凭据继续授权;停用身份仍收集在途结果,但禁止创建新工作。
// lockWorkflowGraph 由内部运行器和已经认证的信号受理事务复用。身份→应用额度→排序队列→实例→门控,
// 运行器不用启动凭据继续授权;停用身份仍收集在途结果,但禁止创建新工作。
func lockWorkflowGraph(ctx context.Context, tx *sql.Tx, ns, id core.ID, skip bool) (*workflowGraph, bool, error) {
var enabled bool
if err := tx.QueryRowContext(ctx, `SELECT n.enabled AND a.enabled FROM orbit_namespaces n JOIN orbit_applications a ON a.id=n.application_id WHERE n.id=? FOR SHARE`, ns).Scan(&enabled); err != nil {