Fix using wrong stats token (#7127)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2024-11-08 00:29:35 +07:00 committed by GitHub
parent 82f0d00170
commit 8a08a22f02
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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(),