Skip to content

Cannot maintain a pool with 1 connection that is allowed to idle #2

@geertweening

Description

@geertweening

When trying to create a pool with the following options I expect to have 1 object available at all times and the object not to be destroyed when it times out.

options {
  "refreshIdle": false,
  "min": 1,
  "max": 1
}

Instead the object is destroyed when the timeout is hit. This happens since the Pool constructor will assume the min should always be at least 1 less than the max. The options above end up resulting in a max of 1 and a min of 0

A simple solution could be to remove the max-1 assumption for the min value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions