From c6c4cfa9f4ff52662b9f595f67b6f0da3c597fdc Mon Sep 17 00:00:00 2001 From: Matt Cook Date: Fri, 11 Oct 2024 14:34:21 -0600 Subject: [PATCH] set sane defaults for monitoring interval. default to monitoring enabled --- .../us/dot/its/jpo/ode/traveler/TimDepositController.java | 4 +++- sample.env | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/jpo-ode-svcs/src/main/java/us/dot/its/jpo/ode/traveler/TimDepositController.java b/jpo-ode-svcs/src/main/java/us/dot/its/jpo/ode/traveler/TimDepositController.java index 1cf03547d..f7f56fbd6 100644 --- a/jpo-ode-svcs/src/main/java/us/dot/its/jpo/ode/traveler/TimDepositController.java +++ b/jpo-ode-svcs/src/main/java/us/dot/its/jpo/ode/traveler/TimDepositController.java @@ -115,7 +115,9 @@ public TimDepositController(OdeProperties odeProperties) { logger.info("TIM ingest monitoring enabled."); ScheduledExecutorService scheduledExecutorService = Executors.newSingleThreadScheduledExecutor(); - Long monitoringInterval = Long.valueOf(odeProperties.getProperty(ConfigEnvironmentVariables.ODE_TIM_INGEST_MONITORING_INTERVAL)); + // 3600 seconds, or one hour, was determined to be a sane default for the monitoring interval if monitoring is enabled + // but there was no interval set in the .env file + Long monitoringInterval = Long.valueOf(odeProperties.getProperty(ConfigEnvironmentVariables.ODE_TIM_INGEST_MONITORING_INTERVAL, "3600")); scheduledExecutorService.scheduleAtFixedRate(new TimIngestWatcher(monitoringInterval), monitoringInterval, monitoringInterval, java.util.concurrent.TimeUnit.SECONDS); } else { diff --git a/sample.env b/sample.env index c950db233..829ff310a 100644 --- a/sample.env +++ b/sample.env @@ -106,5 +106,5 @@ ADM_LOG_TO_CONSOLE=true ADM_LOG_LEVEL=INFO # ODE Monitoring -ODE_TIM_INGEST_MONITORING_ENABLED=false -TIM_INGEST_MONITORING_INTERVAL= \ No newline at end of file +ODE_TIM_INGEST_MONITORING_ENABLED=true +TIM_INGEST_MONITORING_INTERVAL=60 \ No newline at end of file