sindresorhus / capture-website

Capture screenshots of websites
MIT License
1.92k stars 136 forks source link

page.close() and browser.close() should be in try-catch-finally block #90

Open ropel opened 2 years ago

ropel commented 2 years ago

Everytime something goes wrong capturing a screenshot (i.e. no response, timeouts, ...) the function exits without closing page and browser, so that chrome instances keep growing until server dies. Putting page.close() and browser.close() in a "finally" block should avoid resources leaking

sindresorhus commented 2 years ago

I agree. Pull request welcome.

ropel commented 2 years ago

Ok, pull request done

jopemachine commented 2 years ago

Ok, pull request done

Is this issue resolved?

AlejandroAkbal commented 5 months ago

Was this ever merged? Because I'm having zombie processes and I imagine it's because of this