forEach typeorm update cause error: remaining connection slots are reserved for non-replication superuser connections

Viewed 77

How can I deal with this scenario ? A typeOrm based PGSQL update with forEach :

datas.forEach(d => {
    this.entity.update(d.id, {somefields})
}

This cause a PostGreSQL Error :

error: remaining connection slots are reserved for non-replication superuser connections

Tried to limit maxConnections of TypeORM to 5 but still the issue.

0 Answers
Related