Drop all cache of a database when it is dropped

issue4584
review11121002
This commit is contained in:
Cédric Krier committed 2015-03-25 18:56:52 +01:00
1 parent b9e9964157
commit 34fb7d7471
2 files changed
+6

No files matched your search

+5
View File
@@ -116,6 +116,11 @@ class Cache(object):
Cache._resets[dbname].clear()
cursor.commit()
@classmethod
def drop(cls, dbname):
for inst in cls._cache_instance:
inst._cache.pop(dbname, None)
class LRUDict(OrderedDict):
"""
+1
View File
@@ -269,6 +269,7 @@ def drop(database_name, password):
else:
logger.info('DROP DB: %s', database_name)
Pool.stop(database_name)
Cache.drop(database_name)
return True