From 6aea4d06313f6dadfea9617aa4de6a1639785829 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Sat, 6 Nov 2010 13:35:50 +0100 Subject: account cache fix --- module/AccountManager.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'module/AccountManager.py') diff --git a/module/AccountManager.py b/module/AccountManager.py index 70f694fcc..0409e5115 100644 --- a/module/AccountManager.py +++ b/module/AccountManager.py @@ -38,9 +38,7 @@ class AccountManager(): self.plugins = {} self.initAccountPlugins() - - self.accountInfoCache = {} - + self.loadAccounts() self.saveAccounts() # save to add categories to conf @@ -155,16 +153,19 @@ class AccountManager(): p = self.getAccountPlugin(plugin) p.removeAccount(user) + cache = self.accountInfoCache + if self.cache.has_key(p.__name__): + if cache[p].has_key(user): + del cache[p][user] + self.saveAccounts() p.getAllAccounts(force=True) def getAccountInfos(self, force=False, cache=False): data = {} - if not force: - return self.accountInfoCache - elif not cache: + if cache: self.core.scheduler.addJob(0, self.core.accountManager.cacheAccountInfos) #prevent gui from blocking - return self.accountInfoCache + force = False for p in self.accounts.keys(): if self.accounts[p]: -- cgit v1.2.3