Things look mostly resolved, there's some backlogged traffic to work through, but if you're still se
Things look mostly resolved, there's some backlogged traffic to work through, but if you're still seeing high error rates please let me know.
CONNECTION_CLOSEDs instead of timeouts




workerd :lul:// 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());
}
};