From 7370602925b540642ad0f43b0c957ca180dea4b0 Mon Sep 17 00:00:00 2001 From: Easton Crupper <65553218+ecrupper@users.noreply.github.com> Date: Mon, 23 Oct 2023 11:29:43 -0400 Subject: [PATCH] fix(api/build): pop executable when pending build is auto canceled (#990) --- api/build/auto_cancel.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/api/build/auto_cancel.go b/api/build/auto_cancel.go index 975306f8c..9ffb32b26 100644 --- a/api/build/auto_cancel.go +++ b/api/build/auto_cancel.go @@ -43,6 +43,12 @@ func AutoCancel(c *gin.Context, b *library.Build, rB *library.Build, r *library. if err != nil { return false, err } + + // remove executable from table + _, err = database.FromContext(c).PopBuildExecutable(c, rB.GetID()) + if err != nil { + return true, err + } case strings.EqualFold(rB.GetStatus(), constants.StatusRunning) && cancelOpts.Running: // call cancelRunning routine for builds already running on worker err := cancelRunning(c, rB, r)