mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 20:00:47 +00:00
chore: add buildOutput RTK filter, drop legacy cloud sync, internal cleanup
- feat(rtk): buildOutput filter + autodetect for npm/yarn/cargo logs - chore: remove unused cloud sync module and related routes - ui: hide deprecated providers (qwen, iflow, antigravity) - chore: minor tray/cli/internal adjustments
This commit is contained in:
@@ -1,31 +0,0 @@
|
||||
import initializeApp from "@/shared/services/initializeApp";
|
||||
|
||||
// Survive Next.js HMR — module-level flag resets on reload, globalThis persists
|
||||
const g = globalThis.__cloudSyncInit ??= { initialized: false, inProgress: null };
|
||||
|
||||
export async function ensureAppInitialized() {
|
||||
if (g.initialized) return true;
|
||||
if (g.inProgress) return g.inProgress;
|
||||
g.inProgress = (async () => {
|
||||
try {
|
||||
await initializeApp();
|
||||
g.initialized = true;
|
||||
} catch (error) {
|
||||
console.error("[ServerInit] Error initializing app:", error);
|
||||
} finally {
|
||||
g.inProgress = null;
|
||||
}
|
||||
return g.initialized;
|
||||
})();
|
||||
return g.inProgress;
|
||||
}
|
||||
|
||||
// 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") {
|
||||
setImmediate(() => {
|
||||
ensureAppInitialized().catch(console.log);
|
||||
});
|
||||
}
|
||||
|
||||
export default ensureAppInitialized;
|
||||
Reference in New Issue
Block a user