From a7c5ed905ba3e0df2e4431e2931d4215b063f7b5 Mon Sep 17 00:00:00 2001 From: Amit Prinz Setter Date: Wed, 27 Nov 2024 22:48:02 -0800 Subject: [PATCH] nsfs - monitor only nsrs that are mounted. DFBUGS-153 Signed-off-by: Amit Prinz Setter --- src/endpoint/endpoint.js | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/endpoint/endpoint.js b/src/endpoint/endpoint.js index 3025bc05f1..374dd2fa37 100755 --- a/src/endpoint/endpoint.js +++ b/src/endpoint/endpoint.js @@ -207,16 +207,12 @@ async function main(options = {}) { // there for namespace monitor won't be registered if (internal_rpc_client && config.NAMESPACE_MONITOR_ENABLED) { endpoint_stats_collector.instance().set_rpc_client(internal_rpc_client); - - //wait with monitoring until pod has started - setTimeout(() => { - // Register a bg monitor on the endpoint - background_scheduler.register_bg_worker(new NamespaceMonitor({ - name: 'namespace_fs_monitor', - client: internal_rpc_client, - should_monitor: nsr => Boolean(nsr.nsfs_config), - })); - }, 1000 * 60); + // Register a bg monitor on the endpoint + background_scheduler.register_bg_worker(new NamespaceMonitor({ + name: 'namespace_fs_monitor', + client: internal_rpc_client, + should_monitor: nsr => Boolean(nsr.nsfs_config && process.env['NSFS_NSR_' + nsr.name]), + })); } if (config.ENABLE_SEMAPHORE_MONITOR) {