Passing a Mysql Lib (same version) Connection into EventHandler but when I start all the config has been dropped and it's trying to connect to localhost.
2019-08-14T14:21:21.188574900Z
(node:25) UnhandledPromiseRejectionWarning: Error: connect ECONNREFUSED 127.0.0.1:3306
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1106:14)
--------------------
at Protocol._enqueue (/src/node_modules/@rodrigogs/mysql-events/node_modules/mysql/lib/protocol/Protocol.js:144:48)
at Protocol.handshake (/src/node_modules/@rodrigogs/mysql-events/node_modules/mysql/lib/protocol/Protocol.js:51:23)
at Connection.connect (/src/node_modules/@rodrigogs/mysql-events/node_modules/mysql/lib/Connection.js:119:18)
at Promise (/src/node_modules/@rodrigogs/mysql-events/lib/connectionHandler.js:6:75)
at new Promise (<anonymous>)
at connect (/src/node_modules/@rodrigogs/mysql-events/lib/connectionHandler.js:6:31)
at connectionHandler (/src/node_modules/@rodrigogs/mysql-events/lib/connectionHandler.js:42:11)
at MySQLEvents.start (/src/node_modules/@rodrigogs/mysql-events/lib/MySQLEvents.js:88:29)
This is because it's not recognizing the Connection as an instance of a connection but instead just as an object so the config is being defaulted again
Now weirdly when it prints out the connection as an object it looks like this
So not sure why it doesn't think it's an instance of connection. I had thought initially mysql lib versions meaning different interface but seem to both be the same "mysql": "^2.17.1",
In my code if I try to the same instanceof Connection check it passes but in the mysqlevents it does not.
Apologies if already seen.
Thanks for the library as well it's been great. I have a fix for this but not sure it's ideal. Will send a PR in later. Been unable to willfully recreate this as well but it has happened a few times. It's very odd.
Seeing an intermittent error.
Passing a Mysql Lib (same version) Connection into EventHandler but when I start all the config has been dropped and it's trying to connect to localhost.
Connection Error
This is because it's not recognizing the Connection as an instance of a connection but instead just as an object so the config is being defaulted again
Now weirdly when it prints out the connection as an object it looks like this
So not sure why it doesn't think it's an instance of connection. I had thought initially mysql lib versions meaning different interface but seem to both be the same "mysql": "^2.17.1",
In my code if I try to the same instanceof Connection check it passes but in the mysqlevents it does not.
Apologies if already seen.
Thanks for the library as well it's been great. I have a fix for this but not sure it's ideal. Will send a PR in later. Been unable to willfully recreate this as well but it has happened a few times. It's very odd.