Handle when the server is off

This commit is contained in:
2020-10-25 20:33:58 +01:00
parent d86369cfc8
commit 9a7e2179b6
3 changed files with 47 additions and 45 deletions

View File

@@ -31,20 +31,20 @@ export default {
},
async send(config, response, res) {
metamod.setMetrics(response.metamod);
sourcemod.setMetrics(response.sourcemod);
sourcepython.setMetrics(response.sourcepython);
game.setStatsMetrics(response.stats, config.game);
game.setInfoMetrics(response.info);
metamod.setMetrics(response ? response.metamod : null);
sourcemod.setMetrics(response ? response.sourcemod : null);
sourcepython.setMetrics(response ? response.sourcepython : null);
game.setStatsMetrics(response ? response.stats : null, config.game);
game.setInfoMetrics(response ? response.info : null);
registry.setDefaultLabels(
config.ip,
config.port,
config.game,
config.tags,
response.metamod,
response.sourcemod,
response.sourcepython,
response ? response.metamod : null,
response ? response.sourcemod : null,
response ? response.sourcepython : null,
);
registry.sendMetrics(config.game, res);