-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reuse Puppeteer browser and page for text parser #388
Comments
I'll give this a go, once #383 is landed. |
Turns out we're going to need this sooner rather than later. I'm using it in #408, and without it, it's going to use too many resources to run the server. Let's do this in class together tomorrow morning. |
This might be overkill, but we could maybe use the puppeteer-cluster module, which does a bunch of this for free. This is sort of what we're doing: https://github.com/thomasdondorf/puppeteer-cluster/blob/HEAD/examples/function-queuing-complex.js. |
@sukhbeersingh This is the updated code: Current state:
Target state:
|
@humphd sorry for my late reply. Do you still want to use puppeteer-cluster? I can have a look at it |
Hey @giatuongtran9 if you want to try this please go ahead. I would love to work on this but I have some assignments backlog for other courses so I won’t be able to touch this until next week. |
@giatuongtran9 I can work with you on this issue. |
@humphd can I take on this issue and assign it to myself? @giatuongtran9 seems to be busy and hasn't responded yet. Don't worry about merging this PR in a hurry if you have other PRs to merge for Friday night/over the weekend. |
@ragnarokatz go for it. I think others are slammed with other work. I'd love a PR for this. |
This was fixed by #540. |
In #383 we are moving to use Puppeteer. This uses a real Chromium browser to render content in a full DOM. We can reuse the
browser
andpage
objects, so we don't have more than one instance. We just have to use a Promise chain pattern, see puppeteer/puppeteer#486 (comment):Depends on #383.
The text was updated successfully, but these errors were encountered: