The problem is from the managing of connection.end() and connection.connect(). I deleted all these commands and it worked pretty well. I'm assuming the code needs a review so the connections at the database don't make problems anymore
Removing all instances of connection.connect() and connection.end() solves the PROTOCOL_ENQUEUE_AFTER_QUIT error for me, but is it the correct way to handle mysql connection(s)?
The problem is from the managing of connection.end() and connection.connect(). I deleted all these commands and it worked pretty well. I'm assuming the code needs a review so the connections at the database don't make problems anymore