Skip to content

Commit

Permalink
set sane defaults for monitoring interval. default to monitoring enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
mcook42 committed Oct 11, 2024
1 parent ad91aeb commit c6c4cfa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions sample.env
Original file line number Diff line number Diff line change
Expand Up @@ -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=
ODE_TIM_INGEST_MONITORING_ENABLED=true
TIM_INGEST_MONITORING_INTERVAL=60

0 comments on commit c6c4cfa

Please sign in to comment.