TimonKK / clickhouse

NodeJS client for ClickHouse
Apache License 2.0
220 stars 122 forks source link

avoid too many event listeners #113

Closed 1u0n closed 2 years ago

1u0n commented 2 years ago

when calling writeRow around a million times in a loop I get "MaxListenersExceededWarning: Possible EventEmitter memory leak detected" warning message, because when waiting for 'drain' the code is not removing the 'error' listener it attaches.

This change just removes the attached 'error' listener and avoids the warning, functionality stays the same.