zerobyte/app/server/modules/lifecycle/bootstrap.ts
Nicolas Meienberger 1efc4c3328
Some checks failed
Release Workflow / determine-release-type (push) Has been cancelled
Release Workflow / checks (push) Has been cancelled
Release Workflow / e2e-tests (push) Has been cancelled
Release Workflow / build-images (push) Has been cancelled
Release Workflow / publish-release (push) Has been cancelled
refactor: remove proxy pattern for db and auth
Since we migrated away from rr this is not needed anymore as the bundler
correctly split chunks
2026-02-13 21:09:52 +01:00

24 lines
500 B
TypeScript

import { runDbMigrations } from "../../db/db";
import { runMigrations } from "./migrations";
import { startup } from "./startup";
let bootstrapPromise: Promise<void> | undefined;
const runBootstrap = async () => {
runDbMigrations();
await runMigrations();
await startup();
};
export const bootstrapApplication = async () => {
if (!bootstrapPromise) {
bootstrapPromise = runBootstrap();
}
try {
await bootstrapPromise;
} catch (err) {
bootstrapPromise = undefined;
throw err;
}
};