@teamscala/service-boot 0.23.285 → 0.23.286
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/two-phase-boot.ts +3 -0
- package/src/ui-service.ts +10 -1
package/package.json
CHANGED
package/src/two-phase-boot.ts
CHANGED
|
@@ -398,9 +398,11 @@ export async function buildFullApp(
|
|
|
398
398
|
|
|
399
399
|
// Client asset building (expensive: Vite build)
|
|
400
400
|
await buildClientAssets(serviceSlug);
|
|
401
|
+
log.info(`[two-phase-boot:${serviceSlug}] phase-2 step: buildClientAssets DONE`);
|
|
401
402
|
|
|
402
403
|
// Scheduled jobs
|
|
403
404
|
startScheduledJobs(config, mountRegistry, serviceSlug);
|
|
405
|
+
log.info(`[two-phase-boot:${serviceSlug}] phase-2 step: scheduledJobs DONE`);
|
|
404
406
|
|
|
405
407
|
// pg-boss (mount for UI services - wasn't mounted in minimal app)
|
|
406
408
|
const { jobs: pgBossJobs } = await mountPgBoss({
|
|
@@ -408,6 +410,7 @@ export async function buildFullApp(
|
|
|
408
410
|
serviceSlug,
|
|
409
411
|
packages: config.server_packages ?? [],
|
|
410
412
|
});
|
|
413
|
+
log.info(`[two-phase-boot:${serviceSlug}] phase-2 step: mountPgBoss DONE (${pgBossJobs.length} jobs)`);
|
|
411
414
|
if (pgBossJobs.length > 0) {
|
|
412
415
|
log.info(
|
|
413
416
|
`[two-phase-boot:${serviceSlug}] pg-boss mounted ${pgBossJobs.length} job(s): ${pgBossJobs.map((j) => j.handlerSlug).join(", ")}`,
|
package/src/ui-service.ts
CHANGED
|
@@ -103,7 +103,16 @@ export async function bootUiService(
|
|
|
103
103
|
// Phase 2: Build full app in background (non-blocking)
|
|
104
104
|
;(async () => {
|
|
105
105
|
try {
|
|
106
|
-
const
|
|
106
|
+
const PHASE2_TIMEOUT_MS = 120_000;
|
|
107
|
+
const fullAppResult = await Promise.race([
|
|
108
|
+
buildFullApp(minimalAppResult, deps),
|
|
109
|
+
new Promise<never>((_, reject) =>
|
|
110
|
+
setTimeout(
|
|
111
|
+
() => reject(new Error(`buildFullApp timed out after ${PHASE2_TIMEOUT_MS / 1000}s — phase 2 hung silently, see step logs`)),
|
|
112
|
+
PHASE2_TIMEOUT_MS,
|
|
113
|
+
),
|
|
114
|
+
),
|
|
115
|
+
]);
|
|
107
116
|
const fullBuildTime = Date.now();
|
|
108
117
|
const fullDuration = fullBuildTime - startTime;
|
|
109
118
|
|