CONNECT_TIMEOUT

I run into a strange problem. I use postgres-js and drizzle in my server. My DB is hosted by scaleway. Everything works fine but after hours of successful connections, i receive a CONNECT_TIMEOUT error. My drizzle connection looks like this and used across the whole project. I cant figure it out why it is behaving this way. Any help would be appreciated
typescript
import { drizzle } from "drizzle-orm/postgres-js";
import postgres from "postgres";

const queryClient = postgres(
process.env.DATABASE_URL
);

export const db = drizzle(queryClient, { logger: true });
typescript
import { drizzle } from "drizzle-orm/postgres-js";
import postgres from "postgres";

const queryClient = postgres(
process.env.DATABASE_URL
);

export const db = drizzle(queryClient, { logger: true });
2 Replies
Angelelz
Angelelz11mo ago
Your driver is the one responsible with connecting to the database You should start there
Lambda
LambdaOP11mo ago
seems like it is an ongoing issue with bun https://github.com/porsager/postgres/pull/738
GitHub
Patch: Connection stuck after a while by wackfx · Pull Request #738...
Hey @porsager I noticed that, after a while, I had random "WRITE_TIMEOUT" // "CONNECT_TIMEOUT" happening and my system became unresposive. It appears that the socket, once close...
Want results from more Discord servers?
Add your server