Skip to content

Commit

Permalink
Prevent service crash on metrics collection
Browse files Browse the repository at this point in the history
  • Loading branch information
holmbergius committed Oct 30, 2023
1 parent c6ac1f0 commit b587967
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/org/ecocean/MetricsBot.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ private static void startCollector(final String context) { //throws IOException

//DO METRICS WORK HERE
public void run() {
try {
++count;
if (new java.io.File("/tmp/WB_METRICSBOT_SHUTDOWN").exists()) {
System.out.println("INFO: MetricsBot.startCollection(" + context + ") shutting down due to file signal");
Expand All @@ -92,6 +93,11 @@ public void run() {
}

refreshMetrics(context);
}
catch(Exception e) {
System.out.println("Hit exception in startCollectot.run() of MetricsBot!");
e.printStackTrace();
}

}

Expand Down

0 comments on commit b587967

Please sign in to comment.