Skip to content
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

handle factoryCreate fail #221

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

handle factoryCreate fail #221

wants to merge 1 commit into from

Conversation

rebareba
Copy link
Contributor

@rebareba rebareba commented Feb 2, 2018

if don't do this ,it would call factory.create() again and again . or I can do like this outside.

const pool = genericPool.createPool(factory, options);
  pool.on('factoryCreateError', function (err) {
    const clientResourceRequest = pool._waitingClientsQueue.dequeue();
    if (clientResourceRequest) {
      clientResourceRequest.reject(err);
    }
  })

Need change _waitingClientsQueue -> waitingClientsQueue and defined Pool.FACTORY_CREATE_ERROR = FACTORY_CREATE_ERROR;

if don't  do this ,it would  call  factory.create() again and again . or I can do like this outside.
const pool = genericPool.createPool(factory, options);
  pool.on('factoryCreateError', function (err) {
    const clientResourceRequest = pool._waitingClientsQueue.dequeue();
    if (clientResourceRequest) {
      clientResourceRequest.reject(err);
    }
  })
Need change _waitingClientsQueue -> waitingClientsQueue and defined Pool.FACTORY_CREATE_ERROR = FACTORY_CREATE_ERROR;
@apmcodes
Copy link

Why is this not yet patched? Unable to use 3.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants