Don't start prometheus service if disabled

This commit is contained in:
Essem 2022-08-25 10:36:44 -05:00
parent ac871cb453
commit 7c1cbbc54b
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C

11
app.js
View file

@ -63,6 +63,12 @@ esmBot ${esmBotVersion} (${(await exec("git rev-parse HEAD").then(output => outp
`);
}
const services = [
{ name: "image", ServiceWorker: ImageWorker }
];
if (process.env.METRICS && process.env.METRICS !== "") services.push({ name: "prometheus", ServiceWorker: PrometheusWorker });
const Admiral = new Fleet({
BotWorker: Shard,
token: `Bot ${process.env.TOKEN}`,
@ -98,10 +104,7 @@ const Admiral = new Fleet({
connectionTimeout: 30000
},
useCentralRequestHandler: process.env.DEBUG_LOG ? false : true, // workaround for eris-fleet weirdness
services: [
{ name: "prometheus", ServiceWorker: PrometheusWorker },
{ name: "image", ServiceWorker: ImageWorker }
]
services
});
if (isMaster) {