From 478264f118b0a72e8c73fcb16b99a380be6b21d5 Mon Sep 17 00:00:00 2001 From: Dev Mittal Date: Wed, 17 Apr 2024 17:24:46 +0530 Subject: [PATCH] fix: [CI-11873]: fixed cleanup issues --- handler/destroy.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/handler/destroy.go b/handler/destroy.go index c76b0fa..bc74f5d 100644 --- a/handler/destroy.go +++ b/handler/destroy.go @@ -39,16 +39,16 @@ func HandleDestroy() http.HandlerFunc { if err != nil { logger.FromRequest(r).WithError(err).WithField("id", s.ID).Errorln("stage mapping does not exist") - WriteError(w, err) + WriteNotFound(w, err) return } - ex.Remove(s.ID) if d != nil { logger.FromRequest(r).WithField("id", s.ID).Traceln("starting the destroy process") if err := d.Engine.Destroy(r.Context()); err != nil { WriteError(w, err) } else { + ex.Remove(s.ID) logger.FromRequest(r). WithField("latency", time.Since(st)). WithField("time", time.Now().Format(time.RFC3339)).