From 4208ce6fe213200ec59449bafaf63fdd0c5ef153 Mon Sep 17 00:00:00 2001 From: ecrupper Date: Mon, 23 Oct 2023 09:54:51 -0500 Subject: [PATCH] fix(api/build): pop executable when pending build is auto canceled --- 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)