Monitoring is showing impact picking back up, working to remediate this.
Monitoring is showing impact picking back up, working to remediate this.
CONNECTION_CLOSEDs instead of timeouts




workerd :lul:CONNECTION_CLOSEDworkerd// Middleware to inject the database client into the context
export const database = async (c: Context, next: Next) => {
if (c.env.ENV === "test") {
const database = new MockDatabaseClient();
c.set("database", database);
await next();
} else {
const sql = postgres(c.env.HYPERDRIVE.connectionString);
const database = new KVDatabaseClient(sql);
c.set("database", database); // set the database client to the context
await next();
// clean up the client ensuring we don't kill the worker before that is completed
c.executionCtx.waitUntil(sql.end());
}
};