From 905c4f7153f30b6a6c764247db06945d12656293 Mon Sep 17 00:00:00 2001 From: Matthew B <106352182+artntek@users.noreply.github.com> Date: Mon, 23 Oct 2023 14:42:25 -0700 Subject: [PATCH] Revert "experiment for healthcheck" This reverts commit b52ed6f27996133147fcb25356ad09ceaeab8d85. --- helm/templates/cronjob.yaml | 25 ------------------- .../org/dataone/cn/indexer/IndexWorker.java | 16 ------------ 2 files changed, 41 deletions(-) delete mode 100644 helm/templates/cronjob.yaml diff --git a/helm/templates/cronjob.yaml b/helm/templates/cronjob.yaml deleted file mode 100644 index 8d442e0f..00000000 --- a/helm/templates/cronjob.yaml +++ /dev/null @@ -1,25 +0,0 @@ -apiVersion: batch/v1 -kind: CronJob -metadata: - name: health-check -spec: - schedule: "* * * * *" # runs the job every minute - jobTemplate: - spec: - template: - spec: - containers: - - name: health-check - image: myimage:latest - command: - - sh - - -c - - > - if [ -f /etc/dataone/health-status ]; then - kubectl patch configmap {{ .Release.Name }}-configfiles - --type merge -p '{"data":{"health-status":"healthy"}}' - else - kubectl patch configmap {{ .Release.Name }}-configfiles - --type merge -p '{"data":{"health-status":"unhealthy"}}' - fi - restartPolicy: OnFailure diff --git a/src/main/java/org/dataone/cn/indexer/IndexWorker.java b/src/main/java/org/dataone/cn/indexer/IndexWorker.java index abd27ca5..6b645de1 100644 --- a/src/main/java/org/dataone/cn/indexer/IndexWorker.java +++ b/src/main/java/org/dataone/cn/indexer/IndexWorker.java @@ -22,10 +22,7 @@ package org.dataone.cn.indexer; import java.io.File; -import java.io.FileOutputStream; import java.io.IOException; -import java.io.OutputStream; -import java.nio.charset.Charset; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -38,7 +35,6 @@ import org.apache.commons.codec.EncoderException; import org.apache.commons.configuration.ConfigurationException; -import org.apache.commons.io.IOUtils; import org.apache.log4j.Logger; import org.apache.solr.client.solrj.SolrServerException; import org.dataone.cn.indexer.annotation.OntologyModelService; @@ -133,18 +129,6 @@ public static void main(String[] args) throws IOException, TimeoutException, Ser loadExternalPropertiesFile(propertyFile); IndexWorker worker = new IndexWorker(); worker.start(); - - try (OutputStream outputStream = new FileOutputStream("/etc/dataone/health-status")) { - IOUtils.write("INDEXWORKER OK", outputStream, Charset.defaultCharset()); - } catch (IOException e) { - throw new RuntimeException("Unable to write /etc/dataone/health-status file", e); - } - -// // Start the health check server -// new Thread(new HealthCheckServer()).start(); -// -// // Set the health check flag -// HealthCheckServer.setStarted(true); } /**