From 05f66bf67b50f4160ebcf5ec97442d691bcb095d Mon Sep 17 00:00:00 2001 From: Yvonnick Esnault Date: Wed, 30 May 2018 17:36:14 +0200 Subject: [PATCH] fix (hooks): delete taskExecutions if can't be executed (#2791) Signed-off-by: Yvonnick Esnault --- engine/hooks/scheduler.go | 1 + 1 file changed, 1 insertion(+) diff --git a/engine/hooks/scheduler.go b/engine/hooks/scheduler.go index e29167236a..b970b176ef 100644 --- a/engine/hooks/scheduler.go +++ b/engine/hooks/scheduler.go @@ -92,6 +92,7 @@ func (s *Service) retryTaskExecutionsRoutine(c context.Context) error { // the branch was deleted from git repository, it will never work if strings.Contains(e.LastError, "branchName parameter must be provided") { log.Warning("Hooks> retryTaskExecutionsRoutine > Do not re-enqueue this taskExecution with lastError %s %d/%d type:%s status:%s len:%d err:%s", e.UUID, e.NbErrors, s.Cfg.RetryError, e.Type, e.Status, len(e.LastError), e.LastError) + s.Dao.DeleteTaskExecution(&e) continue } log.Warning("Hooks> retryTaskExecutionsRoutine > Enqueing with lastError %s %d/%d type:%s status:%s len:%d err:%s", e.UUID, e.NbErrors, s.Cfg.RetryError, e.Type, e.Status, len(e.LastError), e.LastError)