Skip to content
This repository has been archived by the owner on Jul 15, 2024. It is now read-only.

Commit

Permalink
fix: properly get prometheus stats
Browse files Browse the repository at this point in the history
  • Loading branch information
KagChi committed Jan 2, 2023
1 parent 663cde6 commit 23a45e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nezuchan/nezu-gateway",
"version": "1.2.2",
"version": "1.2.3",
"description": "A standalone service for connecting to the Discord gateway.",
"main": "dist",
"scripts": {
Expand Down
6 changes: 3 additions & 3 deletions src/Tasks/PrometheusTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ export class PrometheusTask extends Task {
help: "User count"
});

const socketCollection = new RedisCollection<string, { shardId: string; ping: string }>({ redis: this.container.gateway.redis, hash: Constants.STATUSES_KEY });
const socketCollection = new RedisCollection<string, { shardId: string; ping: string }>({ redis: this.container.gateway.redis, hash: process.env.USE_ROUTING === "true" ? `${this.container.gateway.clientId}:${Constants.STATUSES_KEY}` : Constants.STATUSES_KEY });
const gatewayStatuses = await socketCollection.valuesArray();

const guildCollection = new RedisCollection<string, { member_count: number }>({ redis: this.container.gateway.redis, hash: Constants.GUILD_KEY });
const guildCollection = new RedisCollection<string, { member_count: number }>({ redis: this.container.gateway.redis, hash: process.env.USE_ROUTING === "true" ? `${this.container.gateway.clientId}:${Constants.GUILD_KEY}` : Constants.GUILD_KEY });
const guilds = await guildCollection.valuesArray();

const channelCollection = new RedisCollection<string, { id: string }>({ redis: this.container.gateway.redis, hash: Constants.CHANNEL_KEY });
const channelCollection = new RedisCollection<string, { id: string }>({ redis: this.container.gateway.redis, hash: process.env.USE_ROUTING === "true" ? `${this.container.gateway.clientId}:${Constants.CHANNEL_KEY}` : Constants.CHANNEL_KEY });
const channels = await channelCollection.valuesArray();

guildCounter.reset();
Expand Down

0 comments on commit 23a45e2

Please sign in to comment.