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
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:
@@ -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`);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user