Skip to content

Commit

Permalink
fix: stats don’t reset
Browse files Browse the repository at this point in the history
  • Loading branch information
tippfehlr committed Feb 17, 2024
1 parent c801a3b commit 1e58a46
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ RUN tsc --outDir out/

FROM node:current-alpine AS release
WORKDIR /activity-roles/
RUN apk add python3 make g++ openssl ca-certificates
RUN update-ca-certificates
RUN apk add python3 make g++
COPY img/discord-header.png img/discord-header.png
COPY locales locales
COPY yarn.lock .
Expand Down
9 changes: 6 additions & 3 deletions src/modules/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,20 @@ export const client = new Discord.Client({
export let commandHandler: CommandHandler;


const zeroStats = {
export const stats = {
presenceUpdates: 0,
missingAccess: 0,
rolesAdded: 0,
rolesRemoved: 0,
webSocketErrors: 0
};
export function resetStats() {
stats = zeroStats;
stats.presenceUpdates = 0;
stats.missingAccess = 0;
stats.rolesAdded = 0;
stats.rolesRemoved = 0;
stats.webSocketErrors = 0;
}
export let stats = zeroStats;

client.on(Events.ClientReady, () => {
configureInfluxDB();
Expand Down

0 comments on commit 1e58a46

Please sign in to comment.