Skip to content

Commit

Permalink
cherry-pick #20603 (#20824)
Browse files Browse the repository at this point in the history
Signed-off-by: wang yan <wangyan@vmware.com>
  • Loading branch information
wy65701436 authored Aug 8, 2024
1 parent 73736af commit a3c69a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pkg/task/sweep_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func (sm *sweepManager) Clean(ctx context.Context, execIDs []int64) error {
return errors.Wrap(err, "failed to delete tasks")
}
// delete executions
sql = fmt.Sprintf("DELETE FROM execution WHERE id IN (%s)", orm.ParamPlaceholderForIn(len(params)))
sql = fmt.Sprintf("DELETE FROM execution WHERE id IN (%s) AND id NOT IN (SELECT DISTINCT execution_id FROM task)", orm.ParamPlaceholderForIn(len(params)))
_, err = ormer.Raw(sql, params...).Exec()
if err != nil {
return errors.Wrap(err, "failed to delete executions")
Expand Down

0 comments on commit a3c69a6

Please sign in to comment.