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
  • Loading branch information
didibz authored and ShaneHarvey committed Jul 25, 2018
1 parent fdcf61c commit ff958b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pymongo/mongo_client.py
Original file line number Diff line number Diff line change
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 ff958b7

Please sign in to comment.