feat(db): migrate from lowdb to SQLite with repos pattern
- Add modular DB layer (adapters, migrations, repos, helpers) - Replace localDb/usageDb/requestDetailsDb monoliths with repos - Add Tailscale tunnel integration & status check API - Add /api/cli-tools/all-statuses aggregated endpoint - Add settingsStore (Zustand) and mitm/dbReader - Add DB unit tests (benchmark, concurrent, migration, vs-lowdb)
This commit is contained in:
@@ -20,9 +20,12 @@ export async function ensureAppInitialized() {
|
||||
return g.inProgress;
|
||||
}
|
||||
|
||||
// Auto-initialize at runtime only, not during next build
|
||||
// Auto-initialize at runtime only, not during next build.
|
||||
// Defer to next tick so HTTP server can accept connections before heavy init runs.
|
||||
if (process.env.NEXT_PHASE !== "phase-production-build") {
|
||||
ensureAppInitialized().catch(console.log);
|
||||
setImmediate(() => {
|
||||
ensureAppInitialized().catch(console.log);
|
||||
});
|
||||
}
|
||||
|
||||
export default ensureAppInitialized;
|
||||
|
||||
Reference in New Issue
Block a user