diff --git a/server/core/src/stats.ts b/server/core/src/stats.ts index 030addb3ed..eab940a388 100644 --- a/server/core/src/stats.ts +++ b/server/core/src/stats.ts @@ -99,7 +99,6 @@ export function initStatisticsContext ( console.info('storing measurements into local file', metricsFile) } let oldMetricsValue = '' - const token = generateToken(systemAccountEmail, { name: '' }, { service: 'true' }) const serviceId = encodeURIComponent(os.hostname() + '-' + serviceName) const intTimer = setInterval(() => { @@ -118,6 +117,7 @@ export function initStatisticsContext ( } } if (statsUrl !== undefined) { + const token = generateToken(systemAccountEmail, { name: '' }, { service: 'true' }) const data: ServiceStatistics = { serviceName, cpu: getCPUInfo(),