From 500f104654eeb2509249f5f4ef179787709806f5 Mon Sep 17 00:00:00 2001 From: Adam Mann Date: Thu, 24 Sep 2020 09:22:15 +0100 Subject: [PATCH] Add logging for the start and end of the deletion (#137) * Add logging for the start and end of the deletion * [ci skip] auto patch increment skip-checks: true Co-authored-by: ras-rm-bot <65395820+ras-rm-bot@users.noreply.github.com> --- _infra/helm/action-exporter/Chart.yaml | 2 +- .../ctp/response/action/export/endpoint/DeleteEndpoint.java | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/_infra/helm/action-exporter/Chart.yaml b/_infra/helm/action-exporter/Chart.yaml index 960cc6fa..89f9648f 100644 --- a/_infra/helm/action-exporter/Chart.yaml +++ b/_infra/helm/action-exporter/Chart.yaml @@ -18,4 +18,4 @@ version: 1.2.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. -appVersion: 12.3.11 +appVersion: 12.3.12 diff --git a/src/main/java/uk/gov/ons/ctp/response/action/export/endpoint/DeleteEndpoint.java b/src/main/java/uk/gov/ons/ctp/response/action/export/endpoint/DeleteEndpoint.java index ec256177..dd376667 100644 --- a/src/main/java/uk/gov/ons/ctp/response/action/export/endpoint/DeleteEndpoint.java +++ b/src/main/java/uk/gov/ons/ctp/response/action/export/endpoint/DeleteEndpoint.java @@ -22,13 +22,16 @@ public class DeleteEndpoint { @RequestMapping(method = RequestMethod.DELETE) public ResponseEntity triggerDelete() throws CTPException { try { + log.info("Beginning deletion of old records"); List exportJobs = deleteProcessor.getAllExportJobIdsForDeletion(); for (ExportJob exportJob : exportJobs) { deleteProcessor.triggerDeleteForExportJob(exportJob); } + log.info("Completed deletion of old records. [" + exportJobs.size() + "] exportJobs deleted"); return ResponseEntity.ok() - .body("Deletion of old records from [" + exportJobs.size() + "] exportJobs completed"); + .body( + "Completed deletion of old records. [" + exportJobs.size() + "] exportJobs deleted"); } catch (RuntimeException e) { log.error( "Uncaught exception - transaction rolled back. Will re-run when scheduled by cron", e);