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

@@ -208,6 +208,13 @@ func (r *WorkflowRuntime) consume(ctx context.Context, tx *sql.Tx, g *workflowGr
if _, err := tx.ExecContext(ctx, `UPDATE weave_poll_states SET current_task_id=NULL,next_poll_at=?,resolved_at=?,revision=revision+1,updated_at=? WHERE namespace_id=? AND workflow_id=? AND activation_id=?`, next, settled, now, c.ns, c.workflow, source.activation); err != nil {
return false, err
}
if next != nil {
if err := saveWorkflowClock(ctx, tx, g, row, "POLL", row.view.Revision+1, *next); err != nil {
return false, err
}
} else if err := deleteWorkflowClock(ctx, tx, g, row); err != nil {
return false, err
}
if settled != nil {
waitState := "CANCELLED"
if state == weave.StepSucceeded {