I have a group of workers who are waiting for tasks (using Django as an ORM). My problem is that if there are no jobs for a given period of time (regardless of the MySQL variable wait_timeout), the MySQL connection time ends, and therefore the worker dies.
My first approach to solving this problem was to simply increase the wait_timeout value to a higher integer, but I thought the best solution would be to ping MySQL every 30 minutes or so if there was no problem keeping the connection alive.
So my question is; how can i use django orm just ping mysql to keep in touch live? What is the best practice here, just do a simple silly request?
source
share