Browse files

added support for oursql 0.9.3 autoreconnect parameter

To enable, use something like this in settings.py:

	DATABASE_OPTIONS = {'autoreconnect': True}

See https://bugs.launchpad.net/oursql/+bug/838120
and #9
  • Loading branch information...
1 parent b6c7102 commit 4f8c1d51e8bf40a616c643795113bb30835e823e @dnet dnet committed Feb 25, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 mysql_oursql/standard/base.py
View
3 mysql_oursql/standard/base.py
@@ -163,6 +163,9 @@ def _cursor(self):
kwargs['host'] = settings_dict['HOST']
if settings_dict['PORT']:
kwargs['port'] = int(settings_dict['PORT'])
+ opts = settings_dict['OPTIONS']
+ if 'autoreconnect' in opts:
+ kwargs['autoreconnect'] = opts['autoreconnect']
# We need the number of potentially affected rows after an
# "UPDATE", not the number of changed rows.
kwargs['found_rows'] = True

0 comments on commit 4f8c1d5

Please sign in to comment.