Connection Error
I do a query upon my expres server starts, the query gets done, but after some time poroably 1 min, the database get closed and error is thrown
When i try to ping the url its get timeout, but as soon as i restart my server query gets completed, but again after a 1 min the connection get closed as usual, and this a repeatative process seems
This is what my code looks like
import * as dotenv from "dotenv";
import { drizzle } from "drizzle-orm/node-postgres";
import * as schema from "./schema";
import path from "path";
const db = drizzle(process.env.DATABASE_URL!, { schema: schema });
export default db;


1 Reply
correct-apricot•4mo ago
You can find some advice for connection timeouts here: https://neon.com/docs/connect/connection-latency
Neon
Connection latency and timeouts - Neon Docs
Neon's Scale to zero feature is designed to minimize costs by automatically scaling a compute resource down to zero after a period of inactivity. By default, Neon scales a compute to zero after 5 mi...