From 6cd5581ca6b75bb4569db54895aad1754da3c64c Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Fri, 9 Oct 2020 09:30:48 +0000 Subject: [PATCH] bugfix remove job --- main.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index c7a6df0..5a8a8d9 100644 --- a/main.go +++ b/main.go @@ -288,7 +288,7 @@ func serve() { case hook := <-webhooks.Hooks: runHook(hook) case jobID := <-killers: - kill(jobID) + remove(jobID, false) } } }() @@ -359,14 +359,15 @@ func runHook(hook webhooks.Ref) { log.Printf("gitdeploy job for %s#%s started\n", hook.HTTPSURL, hook.RefName) if err := cmd.Wait(); nil != err { log.Printf("gitdeploy job for %s#%s exited with error: %v", hook.HTTPSURL, hook.RefName, err) - return + } else { + log.Printf("gitdeploy job for %s#%s finished\n", hook.HTTPSURL, hook.RefName) } - log.Printf("gitdeploy job for %s#%s finished\n", hook.HTTPSURL, hook.RefName) + remove(jobID, true) // TODO check for backlog }() } -func kill(jobID string) { +func remove(jobID string, nokill bool) { job, exists := jobs[jobID] if !exists { return