feat: recover workflow waits within original deadlines
This commit is contained in:
@@ -159,13 +159,9 @@ func (r *WorkflowRuntime) advancePoll(ctx context.Context, tx *sql.Tx, g *workfl
|
||||
return false, err
|
||||
}
|
||||
// 只有上一轮成功查询并已分类为PENDING才可以消耗新轮次,不能用时间推进绕过失败预算。
|
||||
var disposition string
|
||||
if err := tx.QueryRowContext(ctx, `SELECT error_code FROM weave_inbox WHERE namespace_id=? AND workflow_id=? AND source_task_id=? AND source_activation_id=? AND state='PROCESSED' ORDER BY source_revision DESC LIMIT 1`, c.ns, c.workflow, lastTask, row.view.ActivationID).Scan(&disposition); err != nil {
|
||||
if err := verifyWorkflowPollPending(ctx, tx, g, row, p, lastTask, now); err != nil {
|
||||
return false, err
|
||||
}
|
||||
if disposition != "POLL_PENDING" {
|
||||
return false, errors.New("poll previous round was not pending")
|
||||
}
|
||||
in, err := pollTaskInput(ctx, tx, g, row, policy.Task)
|
||||
if err != nil {
|
||||
return false, err
|
||||
|
||||
Reference in New Issue
Block a user