Skip to content

Commit ff958b7

Browse files
didibzShaneHarvey
authored andcommitted
PYTHON-1617 Fix database name check in index cache (mongodb#363)
1 parent fdcf61c commit ff958b7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pymongo/mongo_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ def _cache_index(self, dbname, collection, index, cache_for):
636636
expire = datetime.timedelta(seconds=cache_for) + now
637637

638638
with self.__index_cache_lock:
639-
if database not in self.__index_cache:
639+
if dbname not in self.__index_cache:
640640
self.__index_cache[dbname] = {}
641641
self.__index_cache[dbname][collection] = {}
642642
self.__index_cache[dbname][collection][index] = expire

0 commit comments

Comments
 (0)