python - Django ORM on a long running process: [2006, u'MySQL server has gone away'] -
i have long running process, (an crossbar.io python component) wich uses django orm saving on database.
my problem when overpasses mysql idle connection timeout, doesnot auto-reconnects, throw [2006, u'mysql server has gone away']
i have tried defining conn_max_age in django settings 60 seconds, should close connection every minute, , reopen on demand, not seems work.
my settings.py looks this:
databases = { 'default': { 'engine': 'django.db.backends.mysql', 'name': 'name', 'user': 'user', 'password': 'password', 'conn_max_age': 60 } }
and in app, utilize normal simple crud model operations, without doing hand (as seems disable autoreconnection feature of django, said in other similar questions)
python mysql django
No comments:
Post a Comment