Skip to content

Commit 0c96d03

Browse files
committed
fix: docker
1 parent d38e7a4 commit 0c96d03

4 files changed

Lines changed: 16 additions & 9 deletions

File tree

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ COPY packages/public/pino-rotate-file/package.json ./packages/public/pino-rotate
1616
COPY packages/private/backend-core/package.json ./packages/private/backend-core/package.json
1717
COPY packages/private/core/package.json ./packages/private/core/package.json
1818

19+
COPY services/ama-bot/package.json ./services/ama-bot/package.json
1920
COPY services/api/package.json ./services/api/package.json
2021

2122
RUN yarn workspaces focus --all
@@ -28,6 +29,7 @@ COPY packages/public/pino-rotate-file ./packages/public/pino-rotate-file
2829
COPY packages/private/backend-core ./packages/private/backend-core
2930
COPY packages/private/core ./packages/private/core
3031

32+
COPY services/ama-bot ./services/ama-bot
3133
COPY services/api ./services/api
3234

3335
RUN yarn turbo run build

services/ama-bot/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
import { startGuildSyncing } from './lib/client.js';
12
import { gateway } from './lib/gateway.js';
23

34
export async function bin(): Promise<void> {
45
await gateway.connect();
6+
startGuildSyncing();
57
}

services/ama-bot/src/lib/client.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@ import { rest } from './rest.js';
88

99
// keep a copy of the guild ids we manage here to easily patch redis
1010
const guildIds = new Set<Snowflake>();
11-
setInterval(async () => {
12-
void context.redis.set(
13-
GlobalCaches.GuildList.key('AMA'),
14-
GlobalCaches.GuildList.recipe.encode({
15-
guilds: [...guildIds],
16-
}),
17-
);
18-
}, 10_000).unref();
11+
12+
export function startGuildSyncing(): void {
13+
setInterval(async () => {
14+
void context.redis.set(
15+
GlobalCaches.GuildList.key('AMA'),
16+
GlobalCaches.GuildList.recipe.encode({
17+
guilds: [...guildIds],
18+
}),
19+
);
20+
}, 10_000).unref();
21+
}
1922

2023
export const client = new Client({ rest, gateway });
2124

services/ama-bot/src/lib/gateway.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ gateway
1919
.on(WebSocketShardEvents.Error, (shardId, error) => context.logger.error({ shardId, error }, 'Shard ERROR'))
2020
.on(WebSocketShardEvents.Debug, (message, shardId) => context.logger.debug({ shardId }, message))
2121
.on(WebSocketShardEvents.Hello, (shardId) => context.logger.debug({ shardId }, 'Shard HELLO'))
22-
.on(WebSocketShardEvents.Ready, (shardId) => context.logger.debug({ shardId }, 'Shard READY'))
22+
.on(WebSocketShardEvents.Ready, (data, shardId) => context.logger.debug({ data, shardId }, 'Shard READY'))
2323
.on(WebSocketShardEvents.Resumed, (shardId) => context.logger.debug({ shardId }, 'Shard RESUMED'));

0 commit comments

Comments
 (0)