From 7db7e97f3fb6cb9a606951f947fbc532373ad368 Mon Sep 17 00:00:00 2001 From: Anbraten Date: Fri, 2 Sep 2022 22:14:38 +0200 Subject: [PATCH] fix (auto) cancel of blocked pipelines (#1157) --- server/pipeline/cancel.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/pipeline/cancel.go b/server/pipeline/cancel.go index a6e3cf39c..262bc59a7 100644 --- a/server/pipeline/cancel.go +++ b/server/pipeline/cancel.go @@ -29,8 +29,8 @@ import ( // Cancel the build and returns the status. func Cancel(ctx context.Context, store store.Store, repo *model.Repo, build *model.Build) error { - if build.Status != model.StatusRunning && build.Status != model.StatusPending { - return ErrBadRequest{Msg: "Cannot cancel a non-running or non-pending build"} + if build.Status != model.StatusRunning && build.Status != model.StatusPending && build.Status != model.StatusBlocked { + return ErrBadRequest{Msg: "Cannot cancel a non-running or non-pending or non-blocked build"} } procs, err := store.ProcList(build)