feat: implement graceful shutdown handling

This commit is contained in:
syntaxbullet
2026-01-06 17:21:50 +01:00
parent 278ef4b6b0
commit 6ead0c0393
8 changed files with 190 additions and 6 deletions

View File

@@ -4,6 +4,10 @@ import * as schema from "@db/schema";
import { env } from "@lib/env";
const connectionString = env.DATABASE_URL;
const postgres = new SQL(connectionString);
export const postgres = new SQL(connectionString);
export const DrizzleClient = drizzle(postgres, { schema });
export const DrizzleClient = drizzle(postgres, { schema });
export const closeDatabase = async () => {
await postgres.close();
};