Skip to content

Commit

Permalink
PYTHON-1617 Fix database name check in index cache (#363)
Browse files Browse the repository at this point in the history
(cherry picked from commit ff958b7)
  • Loading branch information
didibz authored and ShaneHarvey committed Oct 9, 2018
1 parent 018f1da commit 7759436
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pymongo/mongo_client.py
Expand Up @@ -636,7 +636,7 @@ def _cache_index(self, dbname, collection, index, cache_for):
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
Expand Down

0 comments on commit 7759436

Please sign in to comment.