From d68873ce5de7580ce814cb0fc5283a73a32a470d Mon Sep 17 00:00:00 2001 From: "courtmanr@gmail.com" Date: Mon, 3 Mar 2025 16:14:25 +0000 Subject: [PATCH] perf: standardize polling intervals to fastest settings (1000ms) across all environments --- .env.example | 7 +++---- README.md | 4 ++-- src/config/index.ts | 6 +++--- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.env.example b/.env.example index 278cda6d1..6eb53e286 100644 --- a/.env.example +++ b/.env.example @@ -31,10 +31,9 @@ METRICS_HISTORY_MINUTES=60 # - For development or internal networks, you can set these to true/0 # - For production, set these to false/1 and ensure proper SSL certificates are installed # - Setting these to true/0 disables SSL certificate validation and is not secure for production -IGNORE_SSL_ERRORS=false -NODE_TLS_REJECT_UNAUTHORIZED=1 +IGNORE_SSL_ERRORS=true +NODE_TLS_REJECT_UNAUTHORIZED=0 # Polling Intervals (in milliseconds) -# Optimized for maximum responsiveness - adjust as needed for your environment -NODE_POLLING_INTERVAL_MS=2000 +NODE_POLLING_INTERVAL_MS=1000 EVENT_POLLING_INTERVAL_MS=1000 \ No newline at end of file diff --git a/README.md b/README.md index 8f6ca0631..ddc82cbcd 100644 --- a/README.md +++ b/README.md @@ -153,8 +153,8 @@ PORT=7654 NODE_ENV=production LOG_LEVEL=info METRICS_HISTORY_MINUTES=60 -NODE_POLLING_INTERVAL_MS=10000 -EVENT_POLLING_INTERVAL_MS=2000 +NODE_POLLING_INTERVAL_MS=1000 +EVENT_POLLING_INTERVAL_MS=1000 ``` ### ProxMox API Token Requirements diff --git a/src/config/index.ts b/src/config/index.ts index 13b72581c..c218a4f02 100644 --- a/src/config/index.ts +++ b/src/config/index.ts @@ -84,16 +84,16 @@ function validateConfig(config: AppConfig): void { } } -// Parse and create the configuration object +// Default configuration const config: AppConfig = { - port: parseInt(process.env.PORT || '3000', 10), + port: parseInt(process.env.PORT || '7654', 10), nodeEnv: process.env.NODE_ENV || 'development', logLevel: process.env.LOG_LEVEL || 'info', enableDevTools: process.env.ENABLE_DEV_TOOLS === 'true', metricsHistoryMinutes: parseInt(process.env.METRICS_HISTORY_MINUTES || '60', 10), ignoreSSLErrors: process.env.IGNORE_SSL_ERRORS === 'true', // More responsive polling intervals - reduced for maximum responsiveness - nodePollingIntervalMs: parseInt(process.env.NODE_POLLING_INTERVAL_MS || '2000', 10), + nodePollingIntervalMs: parseInt(process.env.NODE_POLLING_INTERVAL_MS || '1000', 10), eventPollingIntervalMs: parseInt(process.env.EVENT_POLLING_INTERVAL_MS || '1000', 10), nodes: parseNodeConfigs() };