We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
*** Just an update here, i need to explictly call destroy function to release the resourcse***, may be i have configured something incorrectly
Sorry to be posting it here but i am unable to find an answer anywhere else.
I am trying to create a pupeteer pool and the destroy method from the factory is not getting called.
I am able to acquire resource but not able to release and destroy is not called.
here are relevant parts of the code
browser-pool.js
const genericPool = require('generic-pool'); const puppeteer = require('puppeteer'); module.exports = function() { const browserParams = process.env.NODE_ENV == 'development' ? { headless: false, devtools: false, executablePath: '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome' } : { headless: true, devtools: false, executablePath: 'google-chrome-unstable', args: ['--no-sandbox', '--disable-dev-shm-usage'] }; const factory = { create: function() { return puppeteer.launch(browserParams); }, destroy: function(instance) { console.log('closing browser'); instance.close(); }, validate: (browserInstance) => { console.log(`maxUses is ${maxUses}`); return validator(browserInstance) .then(valid => Promise.resolve(valid && (maxUses <= 0 || browserInstance.useCount < maxUses))) }, } const opts = { max: 2 }; return genericPool.createPool(factory, opts); };
processor.js
const pool = require('./browser-pool'); async function performExport(params){ let client = ""; const poolInstance = pool(); const resp = workAround.acquire().then(async function(c){ // do processing poolInstance.release(c); //***Does not call destroy** });
I am missing something but not sure what. Any help would be really great. Thanks
The text was updated successfully, but these errors were encountered:
I'm seeing the same thing. I have my max: 10 and min: 0 and after I release all resources I still have available: 1.
Sorry, something went wrong.
Yes, I'm observing the same.
Additionally, calling drain and clear doesn't call destroy. Why is that?
No branches or pull requests
Hi,
*** Just an update here, i need to explictly call destroy function to release the resourcse***, may be i have configured something incorrectly
Sorry to be posting it here but i am unable to find an answer anywhere else.
I am trying to create a pupeteer pool and the destroy method from the factory is not getting called.
I am able to acquire resource but not able to release and destroy is not called.
here are relevant parts of the code
browser-pool.js
processor.js
I am missing something but not sure what. Any help would be really great. Thanks
The text was updated successfully, but these errors were encountered: