-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
reconnect to mysql when disconnected... #32
Comments
+1 for this, I also experience loss of insert events to the db, caused by loss of connection to the db. |
@uksparky while not the best resolution by any means I used a setInterval for 8 hours to close the connection and restart it and it's been reliable for almost a month now. I have no way of knowing what might be lost in that quick restart, unfortunately |
Thanks for the workaround solution suggestion. Any chance of some example
source so I ensure I wrap the right parts of code inside the setInterval. I
presume your solution tears down the connections/listeners/etc and doesn't
lead to excessive memory usage?
Cheers
…On 4 Aug 2017 02:07, "Thomas Le" ***@***.***> wrote:
@uksparky <https://github.com/uksparky> while not the best resolution by
any means I used a setInterval for 8 hours to close the connection and
restart it and it's been reliable for almost a month now. I have no way of
knowing what might be lost in that quick restart, unfortunately
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#32 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABrPrnSkuVca_BQdCCKp6YN7kE1hk7wHks5sUm6zgaJpZM4OAGxw>
.
|
@tvl83 I also got the same issue. But no idea how you "close the connection and restart it" in the |
@miumax I had this same issue for a while. The code would work nicely and then stop running with no visible sign. I realised, after a while, that I hadn't included the rotate event in the included events for my watcher. Once I set that it worked well. |
@a-k-macdonald Can you please give some code example about how to include that rotate event to watcher. |
@miumax I set up my connection as below,
I take the defaults for everything else. I hope that helps. |
@a-k-macdonald Big thank, I'll do a try. |
@a-k-macdonald No luck. |
@miumax Sorry, I don't know what to suggest then. |
Using this lib you can pass a MySQL connection object to the constructor. So you're able to controll your connection out of the box. |
Were you able to solve the problem ? |
Is there a way to detect if I am still connected to mysql and then reconnect if so?
I am using this library to update a firebase live db with information to use in an app. It seems around ~8-9 hours the updates just halt with no errors at all. I can only assume it is, for some reason, disconnecting from the mysqldb.
My initial thought is to run a cronjob every 7hr 55min or so to restart the nodejs app service.
I have a couple things that could be messed up by this even though the restart will be about 1 second long it can potentially cause issues every once in a while so I want to see about just reconnecting once it is disconnected.
Thank you
The text was updated successfully, but these errors were encountered: