feat: recover poll activations within original round budgets
This commit is contained in:
@@ -61,7 +61,7 @@ func appendWorkflowResult(ctx context.Context, tx *sql.Tx, ns, eventID, taskID c
|
||||
return errors.New("poll activation cannot own a direct task")
|
||||
}
|
||||
var round uint32
|
||||
err = tx.QueryRowContext(ctx, `SELECT r.round FROM weave_poll_rounds r JOIN weave_poll_states p ON p.namespace_id=r.namespace_id AND p.workflow_id=r.workflow_id AND p.activation_id=r.activation_id WHERE r.namespace_id=? AND r.workflow_id=? AND r.activation_id=? AND r.task_id=? AND r.round BETWEEN 1 AND p.used_rounds`, ns, workflow, ownerID, taskID).Scan(&round)
|
||||
err = tx.QueryRowContext(ctx, `SELECT r.round FROM weave_poll_rounds r JOIN weave_poll_states p ON p.namespace_id=r.namespace_id AND p.workflow_id=r.workflow_id AND p.activation_id=r.activation_id WHERE r.namespace_id=? AND r.workflow_id=? AND r.activation_id=? AND r.task_id=? AND r.round BETWEEN p.first_round AND p.used_rounds`, ns, workflow, ownerID, taskID).Scan(&round)
|
||||
if errors.Is(err, sql.ErrNoRows) {
|
||||
return errors.New("workflow poll task association invalid")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user