From fb40abfd4818d41a42599ca555a400d879eb2501 Mon Sep 17 00:00:00 2001 From: Nathan Coad Date: Tue, 15 Oct 2024 17:05:14 +1100 Subject: [PATCH] re-enable endpoint to remove updates with no associated inventory record --- server/handler/updateCleanup.go | 3 ++- server/router/router.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/server/handler/updateCleanup.go b/server/handler/updateCleanup.go index a2b190e..a122760 100644 --- a/server/handler/updateCleanup.go +++ b/server/handler/updateCleanup.go @@ -26,7 +26,8 @@ func (h *Handler) UpdateCleanup(w http.ResponseWriter, r *http.Request) { err := h.Database.Queries().CleanupUpdates(context.Background(), params) */ - err := h.Database.Queries().InventoryCleanupTemplates(context.Background()) + //err := h.Database.Queries().InventoryCleanupTemplates(context.Background()) + err := h.Database.Queries().CleanupUpdatesNullVm(context.Background()) if err != nil { h.Logger.Error("Error received cleaning updates table", "error", err) diff --git a/server/router/router.go b/server/router/router.go index 83796c9..8a2bfdc 100644 --- a/server/router/router.go +++ b/server/router/router.go @@ -41,7 +41,7 @@ func New(logger *slog.Logger, database db.Database, buildTime string, sha1ver st //mux.HandleFunc("/api/inventory/vm/update", h.VmUpdateDetails) // temporary endpoint - //mux.HandleFunc("/api/cleanup/updates", h.UpdateCleanup) + mux.HandleFunc("/api/cleanup/updates", h.UpdateCleanup) //mux.HandleFunc("/api/cleanup/vcenter", h.VcCleanup) mux.HandleFunc("/api/report/inventory", h.InventoryReportDownload)