diff --git a/package-lock.json b/package-lock.json index 66ce112..aceb92c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "3.0.8", "license": "MIT", "dependencies": { + "@pushrocks/smartdelay": "^2.0.13", "@pushrocks/smartfile": "^10.0.5", "@pushrocks/smartnetwork": "^3.0.0", "@pushrocks/smartpath": "^5.0.5", diff --git a/package.json b/package.json index bcf6edf..7d958ad 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "@types/node": "^18.7.14" }, "dependencies": { + "@pushrocks/smartdelay": "^2.0.13", "@pushrocks/smartfile": "^10.0.5", "@pushrocks/smartnetwork": "^3.0.0", "@pushrocks/smartpath": "^5.0.5", diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 1e36c8d..033ddc6 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@pushrocks/smartpdf', - version: '3.0.8', + version: '3.0.9', description: 'create pdfs on the fly' } diff --git a/ts/smartpdf.classes.smartpdf.ts b/ts/smartpdf.classes.smartpdf.ts index 1b3e577..67fa2e9 100644 --- a/ts/smartpdf.classes.smartpdf.ts +++ b/ts/smartpdf.classes.smartpdf.ts @@ -84,6 +84,7 @@ export class SmartPdf { const response = await page.goto(`http://localhost:3210/${pdfCandidate.pdfId}`, { waitUntil: 'networkidle2', }); + await plugins.smartdelay.delayFor(1000); const headers = response.headers(); if (headers['pdf-id'] !== pdfCandidate.pdfId) { console.log('Error! Headers do not match. For security reasons no pdf is being emitted!'); diff --git a/ts/smartpdf.plugins.ts b/ts/smartpdf.plugins.ts index 7c2d0a4..785d790 100644 --- a/ts/smartpdf.plugins.ts +++ b/ts/smartpdf.plugins.ts @@ -6,13 +6,14 @@ export { http, path }; // @pushrocks import * as smartfile from '@pushrocks/smartfile'; +import * as smartdelay from '@pushrocks/smartdelay'; import * as smartpromise from '@pushrocks/smartpromise'; import * as smartpath from '@pushrocks/smartpath'; import * as smartpuppeteer from '@pushrocks/smartpuppeteer'; import * as smartnetwork from '@pushrocks/smartnetwork'; import * as smartunique from '@pushrocks/smartunique'; -export { smartfile, smartpromise, smartpath, smartpuppeteer, smartunique, smartnetwork }; +export { smartfile, smartdelay, smartpromise, smartpath, smartpuppeteer, smartunique, smartnetwork }; // tsclass scope import * as tsclass from '@tsclass/tsclass';