Skip to content

Commit

Permalink
simplify the patch.
Browse files Browse the repository at this point in the history
  • Loading branch information
benoitc committed Feb 21, 2012
1 parent b0c542e commit 52a9e2e
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions gunicorn/monkey.py
Expand Up @@ -18,21 +18,11 @@ def patch_django():
import thread
_get_ident = thread.get_ident

def _init(self, settings_dict, alias=DEFAULT_DB_ALIAS,
allow_thread_sharing=False):
self.connection = None
self.queries = []
self.settings_dict = settings_dict
self.alias = alias
self.use_debug_cursor = None

# Transaction related attributes
self.transaction_state = []
self.savepoint_state = 0
self._dirty = None
self._thread_ident = _get_ident()
self.allow_thread_sharing = allow_thread_sharing
__old__init__ = BaseDatabaseWrapper.__init__

def _init(self, *args, **kwargs):
__old__init__(self, *args, **kwargs)
self._thread_ident = _get_ident()

def _validate_thread_sharing(self):
if (not self.allow_thread_sharing
Expand Down

0 comments on commit 52a9e2e

Please sign in to comment.