Skip to content

Commit cbb41d2

Browse files
authored
Merge pull request #284 from yashsinghcodes/main
check baseExecution before validating worker request
2 parents 2458bc9 + 69fb5a7 commit cbb41d2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

shared.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22094,6 +22094,11 @@ func ValidateNewWorkerExecution(ctx context.Context, body []byte, shouldReset bo
2209422094
return errors.New(fmt.Sprintf("Bad length of trigger: %d (probably normal app)", len(execution.Workflow.Triggers)))
2209522095
}
2209622096

22097+
if baseExecution.Status == "FINISHED" || baseExecution.Status == "ABORTED" || baseExecution.Status == "FAILURE" {
22098+
log.Printf("[INFO][%s] Execution is already finished, not overriding", execution.ExecutionId)
22099+
return errors.New("Execution is already finished, not overriding")
22100+
}
22101+
2209722102
if len(baseExecution.Results) > len(execution.Results) {
2209822103
if shouldReset == true {
2209922104
// Letting it pass and override. This is to ensure worker can override

0 commit comments

Comments
 (0)