PYTHON-1617 Fix database name check in index cache (#363)

(cherry picked from commit ff958b7d67)
This commit is contained in:
Didi Bar-Zev 2018-07-25 20:18:25 +03:00 committed by Shane Harvey
parent 018f1da04a
commit 775943602a

View File

@ -636,7 +636,7 @@ class MongoClient(common.BaseObject):
expire = datetime.timedelta(seconds=cache_for) + now
with self.__index_cache_lock:
if database not in self.__index_cache:
if dbname not in self.__index_cache:
self.__index_cache[dbname] = {}
self.__index_cache[dbname][collection] = {}
self.__index_cache[dbname][collection][index] = expire