Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/hooks.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import '$lib/server/trino/config.js';
import { storageEncryptionKey } from '$lib/server/storage/encryption-key.js';
import { notConnected } from '$lib/server/storage/not-connected.js';
import { runMigrations } from '$lib/server/migrate.js';
import { closeDb } from '$lib/server/db.js';

// Allow self-signed TLS certificates in development (e.g. local Trino with self-signed certs).
if (dev) {
Expand Down Expand Up @@ -177,6 +178,10 @@ export const init: ServerInit = async () => {
if (storageBrowserEnabled) {
storageEncryptionKey(); // throws immediately if the env var is missing/invalid
}
// adapter-node stops the HTTP server on SIGTERM/SIGINT but leaves the process
// to exit on its own; idle pool connections would keep it alive for
// idleTimeoutMillis.
process.once('sveltekit:shutdown', () => void closeDb());
// Only logs the cause of a failure: the provider may just be down, and existing
// sessions keep working without it. Not awaited, so it doesn't delay startup.
if (oidcEnabled) void checkOidcDiscovery(oidcDiscoveryUrl!);
Expand Down
Loading