From 306c4c858e57fe01f639d4762bb11035aca49aa2 Mon Sep 17 00:00:00 2001 From: FoxxMD Date: Fri, 27 Mar 2026 18:51:00 +0000 Subject: [PATCH] fix: Only enable metrics collection for real runs --- src/backend/common/Cache.ts | 7 ++++--- src/backend/index.ts | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/backend/common/Cache.ts b/src/backend/common/Cache.ts index f810a95a..3576cc1d 100644 --- a/src/backend/common/Cache.ts +++ b/src/backend/common/Cache.ts @@ -109,12 +109,13 @@ export class MSCache { this.cacheClientScrobbles.stats.enabled = true; } - init = async () => { + init = async (enableCollectors: boolean = false) => { await this.initMetadataCache(); await this.initScrobbleCache(); await this.initAuthCache(); - this.enableCollectors(); - //this.cacheTransform = await this.initCacheable({provider: false, memory: {lruSize: 500}}, 'transform'); + if(enableCollectors) { + this.enableCollectors(); + } } protected enableCollectors = () => { diff --git a/src/backend/index.ts b/src/backend/index.ts index f3759c31..34036bb3 100644 --- a/src/backend/index.ts +++ b/src/backend/index.ts @@ -109,7 +109,7 @@ const configDir = process.env.CONFIG_DIR || path.resolve(projectDir, `./config`) const scrobbleClients = new ScrobbleClients(root.get('clientEmitter'), root.get('sourceEmitter'), internalConfigOptional, root.get('logger')); const scrobbleSources = new ScrobbleSources(root.get('sourceEmitter'), internalConfigOptional, root.get('logger')); - await root.items.cache().init(); + await root.items.cache().init(true); initServer(logger, appLoggerStream, output, scrobbleSources, scrobbleClients); -- 2.51.2