Railway connection closing
Hi! I have this problem regarding railway's deployment. So far, deploying my application is fine, however after a day or at least in a few dozen hours, i get this error:
Anyone how this is caused? and how to prevent this from happening? Thank you.
17 Replies
Project ID:
N/A
N/A
going to need more info, what kind of app is this
an app that is connected to azure mysql from a node.js backend. I usually have to redeploy to make it work again.
i wonder if azure stops connections over a period of time
what client library are you using
axios
thats an http request library, we are talking about mysql
oh mb, mysql2 npm package?
are you releasing the connection after your query?
no i am not
maybe i should use createPool instead?
are you currently using any kind of pool
no
i noticed in my code im using one instance of db.connect(), so maybe that causing issues?
then you should be closing the connections after you make the queries
you are currently trying to re-used a closed connection
for transparency, this isnt an issue with railway or azure, this is a code issue
sorry
sorry? you havent done anything wrong?
its just that most of the other coding platform places are very inactive so im still looking for more places for help
no worries at all, while coding help is a bit out of scope for these threads, im just trying to push you in the right direction