Skip to content

handle factoryCreate fail#221

Open
rebareba wants to merge 1 commit intocoopernurse:masterfrom
rebareba:patch-2
Open

handle factoryCreate fail#221
rebareba wants to merge 1 commit intocoopernurse:masterfrom
rebareba:patch-2

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