If fileStream is sucessful everything works out fine. However, if fileStream has an error (for example a timeout if file is over ftp), then dbStream remains dangling. If I connect to postres the query is marked as active. I've tried, dbStream.emit('error', e), or dbStream.destroy() to no avail.
Any idea?
One option would be to open a different connection to the db to do pg_cancel_backend but it really doesn't seem like the way.
Hi, I'm using this library to pipe large csvs to db. It's been good so far, but It is not clear to me how to handle errors.
Basically I have a fileStream and a dbStream, first one reads from a csv, second one pipes to db
If fileStream is sucessful everything works out fine. However, if fileStream has an error (for example a timeout if file is over ftp), then dbStream remains dangling. If I connect to postres the query is marked as active. I've tried, dbStream.emit('error', e), or dbStream.destroy() to no avail.
Any idea?
One option would be to open a different connection to the db to do pg_cancel_backend but it really doesn't seem like the way.
Thanks