File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change 3
3
4
4
from django .core .exceptions import ImproperlyConfigured
5
5
from django .db .backends .base .base import BaseDatabaseWrapper
6
+ from django .utils .asyncio import async_unsafe
6
7
from pymongo .collection import Collection
7
8
from pymongo .driver_info import DriverInfo
8
9
from pymongo .mongo_client import MongoClient
@@ -172,6 +173,7 @@ def get_connection_params(self):
172
173
** settings_dict ["OPTIONS" ],
173
174
}
174
175
176
+ @async_unsafe
175
177
def get_new_connection (self , conn_params ):
176
178
return MongoClient (** conn_params , driver = self ._driver_info ())
177
179
@@ -189,11 +191,13 @@ def _rollback(self):
189
191
def set_autocommit (self , autocommit , force_begin_transaction_with_broken_autocommit = False ):
190
192
pass
191
193
194
+ @async_unsafe
192
195
def close (self ):
193
196
super ().close ()
194
197
with contextlib .suppress (AttributeError ):
195
198
del self .database
196
199
200
+ @async_unsafe
197
201
def cursor (self ):
198
202
return Cursor ()
199
203
You can’t perform that action at this time.
0 commit comments