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

Commit

Permalink
fix: close migrations client
Browse files Browse the repository at this point in the history
Co-authored-by: KagChi <[email protected]>
Co-authored-by: Vann <[email protected]>
  • Loading branch information
3 people authored Feb 20, 2024
1 parent 46a7f49 commit c12d2ec
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion services/kanao-gateway/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ const gateway = new NezuGateway();
const packageJson = Util.loadJSON<{ version: string; }>(`file://${join(fileURLToPath(import.meta.url), "../../package.json")}`);
const shardIds = await getShardCount();

await migrate(drizzle(postgres(databaseUrl, { max: 1, onnotice: notice => gateway.logger.debug(notice, "Migrating Table") })), { migrationsFolder: "./node_modules/@nezuchan/kanao-schema/drizzle" });
const migClient = postgres(databaseUrl, { max: 1, onnotice: notice => gateway.logger.debug(notice, "Migrating Table") });

await migrate(drizzle(migClient), { migrationsFolder: "./node_modules/@nezuchan/kanao-schema/drizzle" });

await migClient.end();

try {
await gateway.connect();
Expand Down

0 comments on commit c12d2ec

Please sign in to comment.