mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
simplify the patch.
This commit is contained in:
parent
b0c542e80e
commit
52a9e2e9a2
@ -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
|
||||
__old__init__ = BaseDatabaseWrapper.__init__
|
||||
|
||||
# Transaction related attributes
|
||||
self.transaction_state = []
|
||||
self.savepoint_state = 0
|
||||
self._dirty = None
|
||||
def _init(self, *args, **kwargs):
|
||||
__old__init__(self, *args, **kwargs)
|
||||
self._thread_ident = _get_ident()
|
||||
self.allow_thread_sharing = allow_thread_sharing
|
||||
|
||||
|
||||
def _validate_thread_sharing(self):
|
||||
if (not self.allow_thread_sharing
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user