You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem:
If i start md2pdf with a lot of md files, I get some warnings:
> md2pdf ../mds/**/*.md
(node:40269) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 exit listeners added to [process]. Use emitter.setMaxListeners() to increase limit
(Use `node --trace-warnings ...` to show where the warning was created)
(node:40269) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGINT listeners added to [process]. Use emitter.setMaxListeners() to increase limit
(node:40269) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGTERM listeners added to [process]. Use emitter.setMaxListeners() to increase limit
(node:40269) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGHUP listeners added to [process]. Use emitter.setMaxListeners() to increase limit
For each file a seperate pupeteer.launch() function is called in generate-output.ts.
This registers a lot of system listeners. const browser = await puppeteer.launch({ devtools: config.devtools, ...config.launch_options });
Solution:
Use one single browser instance and create for each convertToPdf just an browser context. const listrContext = await browser.createIncognitoBrowserContext();
Pass this Context down the functions and use this, to create and manipulate the pages with puppeteer.
I just added this feature locally, but i can not push due to 403.
How can i push my Branch and open a PR for Review?
The text was updated successfully, but these errors were encountered:
Hey thanks i've actually been wanting to do that for a while but never got around to it (i've personally never used it with multiple files 😅). Usually you'll have to fork the repo first and then you can make a PR from your fork's branch to this repo. But I'll just add you as a collaborator temporarily.
This feature uses puppeteer.BrowserContext for the convertion tasks.
Now, not for each task, an own browser instance is instantiated, but
only one. This one and only is used, and only browserContexts are passed
down to the convertion functions.
Reduces CPU Load, eliminates EventEmitter warnings and speed up
conversion of large amount of files by ~50%.
Problem:
If i start
md2pdf
with a lot of md files, I get some warnings:For each file a seperate
pupeteer.launch()
function is called ingenerate-output.ts
.This registers a lot of system listeners.
const browser = await puppeteer.launch({ devtools: config.devtools, ...config.launch_options });
Solution:
Use one single browser instance and create for each
convertToPdf
just an browser context.const listrContext = await browser.createIncognitoBrowserContext();
Pass this Context down the functions and use this, to create and manipulate the pages with puppeteer.
I just added this feature locally, but i can not push due to 403.
How can i push my Branch and open a PR for Review?
The text was updated successfully, but these errors were encountered: