feat: recover workflow waits within original deadlines
This commit is contained in:
@@ -31,6 +31,11 @@ type workflowResult struct {
|
||||
}
|
||||
|
||||
func readWorkflowResult(ctx context.Context, tx *sql.Tx, g *workflowGraph, c workflowCandidate, now time.Time) (*workflowResult, error) {
|
||||
return readWorkflowResultState(ctx, tx, g, c, now, "PENDING")
|
||||
}
|
||||
|
||||
// readWorkflowResultState 复用不可变来源核验;管理恢复只读取已处理快照,不改写原Inbox处置。
|
||||
func readWorkflowResultState(ctx context.Context, tx *sql.Tx, g *workflowGraph, c workflowCandidate, now time.Time, required string) (*workflowResult, error) {
|
||||
var state string
|
||||
var due time.Time
|
||||
var raw []byte
|
||||
@@ -42,7 +47,7 @@ func readWorkflowResult(ctx context.Context, tx *sql.Tx, g *workflowGraph, c wor
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if state != "PENDING" || due.After(now) {
|
||||
if state != required || required == "PENDING" && due.After(now) {
|
||||
return nil, nil
|
||||
}
|
||||
if _, err := jsonvalue.Canonical(raw); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user