Drop all cache of a database when it is dropped
issue4584 review11121002
This commit is contained in:
1 parent
b9e9964157
commit
34fb7d7471
2 files changed
+6
No files matched your search
@@ -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):
|
||||
"""
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user