fix(pdf): decouple 6 distinct PDFs, fix layout issues and DataForSEO event loop
Some checks failed
Monorepo Pipeline / ⚡ Prioritize Release (push) Successful in 1s
Monorepo Pipeline / 🧹 Lint (push) Failing after 1m1s
Monorepo Pipeline / 🧪 Test (push) Failing after 1m7s
Monorepo Pipeline / 🏗️ Build (push) Failing after 1m10s
Monorepo Pipeline / 🚀 Release (push) Has been skipped
Monorepo Pipeline / 🐳 Build Image Processor (push) Has been skipped
Monorepo Pipeline / 🐳 Build Directus (Base) (push) Has been skipped
Monorepo Pipeline / 🐳 Build Gatekeeper (Product) (push) Has been skipped
Monorepo Pipeline / 🐳 Build Build-Base (push) Has been skipped
Monorepo Pipeline / 🐳 Build Production Runtime (push) Has been skipped

This commit is contained in:
2026-02-27 18:26:00 +01:00
parent 60a2709999
commit a43d96dd0e
12 changed files with 187 additions and 102 deletions

View File

@@ -83,24 +83,31 @@ export class DataForSeoClient {
let delay = 15_000;
let pollCount = 0;
while (Date.now() - start < timeoutMs) {
await this.sleep(delay);
pollCount++;
// Force Node event loop active
const keepAlive = setInterval(() => { }, 1000);
const ready = await this.isTaskReady(taskId);
const elapsed = Math.round((Date.now() - start) / 1000);
console.log(` 📊 Poll #${pollCount}: ${ready ? "READY ✅" : "not ready"} (${elapsed}s elapsed)`);
try {
while (Date.now() - start < timeoutMs) {
await this.sleep(delay);
pollCount++;
if (ready) {
// Short grace period so the pages endpoint settles
await this.sleep(5_000);
return;
const ready = await this.isTaskReady(taskId);
const elapsed = Math.round((Date.now() - start) / 1000);
console.log(` 📊 Poll #${pollCount}: ${ready ? "READY ✅" : "not ready"} (${elapsed}s elapsed)`);
if (ready) {
// Short grace period so the pages endpoint settles
await this.sleep(5_000);
return;
}
delay = Math.min(delay * 1.3, 30_000);
}
delay = Math.min(delay * 1.3, 30_000);
throw new Error(`DataForSEO task ${taskId} timed out after ${timeoutMs / 1000}s`);
} finally {
clearInterval(keepAlive);
}
throw new Error(`DataForSEO task ${taskId} timed out after ${timeoutMs / 1000}s`);
}
/**