Skip to content

pg-pool: there is no indication when pool becomes idle #2209

@pkit

Description

@pkit

Currently there is no event emitted when pool has some idle connections.
Which makes it impossible to efficiently manage the pool queue.
You need to poll pool.idleCount (or some other counts) all the time.
I have added this.emit('idle') in release which seems to work

....
this._idle.set(client.processID, new IdleItem(client, tid))
this.emit('idle')
....

Is there a problem with that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions