From f895a2a4109cc3f9e6043b0cda2219d95255fa1e Mon Sep 17 00:00:00 2001 From: Johannes Brandenburger <79154528+johannesbrandenburger@users.noreply.github.com> Date: Fri, 19 Jan 2024 11:40:53 +0100 Subject: [PATCH] try catch views --- services/heatmap-service/index.js | 2 +- services/heatmap-service/version.txt | 2 +- services/pin-service/index.js | 2 +- services/pin-service/version.txt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/services/heatmap-service/index.js b/services/heatmap-service/index.js index 184cbe5..e8ed738 100644 --- a/services/heatmap-service/index.js +++ b/services/heatmap-service/index.js @@ -22,7 +22,7 @@ const polygonCollection = database.collection("polygon"); const heatRegionStateCollection = database.collection("heatRegionState"); // create a view that joins the heatRegion and polygon collections -await database.command({ drop: "heatRegionStateWithPolygonView" }); +try { await database.command({ drop: "heatRegionStateWithPolygonView" }); } catch (e) { } // polygon: {polygonname: string, polygon: []} // heatRegionWithPolygonView: { timestamp: string, heatRegions: [{ polygonname: string, density: number (0-1), count: number, polygon: [] }] } await database.command({ diff --git a/services/heatmap-service/version.txt b/services/heatmap-service/version.txt index 6a2b0ac..b482243 100644 --- a/services/heatmap-service/version.txt +++ b/services/heatmap-service/version.txt @@ -1 +1 @@ -v1.0.1 \ No newline at end of file +v1.0.2 \ No newline at end of file diff --git a/services/pin-service/index.js b/services/pin-service/index.js index 1671510..a1947fe 100644 --- a/services/pin-service/index.js +++ b/services/pin-service/index.js @@ -22,7 +22,7 @@ const polygonCollection = database.collection("polygon"); const heatRegionCollection = database.collection("heatRegion"); // create a view that joins the pin and polygon collections -await database.command({ drop: "pinWithPolygonView" }); +try { await database.command({ drop: "pinWithPolygonView" }); } catch (e) { } await database.command({ create: "pinWithPolygonView", viewOn: "pin", diff --git a/services/pin-service/version.txt b/services/pin-service/version.txt index 13637f4..3b9e5db 100644 --- a/services/pin-service/version.txt +++ b/services/pin-service/version.txt @@ -1 +1 @@ -v1.0.3 \ No newline at end of file +v1.0.4 \ No newline at end of file