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

Commit

Permalink
fix(KanaoCache): fix counts rpc response
Browse files Browse the repository at this point in the history
  • Loading branch information
Hazmi35 authored Feb 24, 2024
1 parent 1eb4277 commit 7f8b857
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions services/kanao-cache/src/Structures/KanaoCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,12 @@ export class KanaoCache extends EventEmitter {
await channel.consume(rpc.queue, async message => {
if (message) {
const content = JSON.parse(message.content.toString()) as { replyTo: string; };
const guilds = await this.drizzle.select({ count: count(schema.guilds.id) }).from(schema.guilds).execute();
const users = await this.drizzle.select({ count: count(schema.users.id) }).from(schema.users).execute();
const channels = await this.drizzle.select({ count: count(schema.channels.id) }).from(schema.channels).execute();
const guilds = await this.drizzle.select({ count: count(schema.guilds.id) }).from(schema.guilds).execute()
.then(rows => rows[0].count);
const users = await this.drizzle.select({ count: count(schema.users.id) }).from(schema.users).execute()
.then(rows => rows[0].count);
const channels = await this.drizzle.select({ count: count(schema.channels.id) }).from(schema.channels).execute()
.then(rows => rows[0].count);

channel.ack(message);
await this.amqp.sendToQueue(content.replyTo, Buffer.from(
Expand Down

0 comments on commit 7f8b857

Please sign in to comment.