示例#1
0
 def clear_cache(self):
     cache_db.set_remove("orgs", self.id)
     cache_db.list_remove("orgs_sorted", self.id)
     cache_db.decrement("org_count")
     cache_db.remove(self.get_cache_key("users_cached"))
     cache_db.remove(self.get_cache_key("users"))
     CacheTrie(self.get_cache_key("users_trie")).clear_cache()
     Config.clear_cache(self)
示例#2
0
文件: user.py 项目: ogrishman/pritunl
 def clear_cache(self):
     if self.type == CERT_CLIENT:
         cache_db.decrement(self.org.get_cache_key('user_count'))
     if self.type != CERT_CA:
         cache_db.set_remove(self.org.get_cache_key('users'), self.id)
         cache_db.list_remove(self.org.get_cache_key('users_sorted'),
             self.id)
         self._remove_cache_trie_key()
     Config.clear_cache(self)
示例#3
0
 def clear_cache(self, org_data=True):
     if org_data:
         if self.type == CERT_CLIENT:
             cache_db.decrement(self.org.get_cache_key('user_count'))
         if self.type != CERT_CA:
             cache_db.set_remove(self.org.get_cache_key('users'), self.id)
             cache_db.list_remove(self.org.get_cache_key('users_sorted'),
                 self.id)
     if self.type != CERT_CA:
         self._remove_cache_trie_key()
     cache_db.remove(self.get_cache_key('otp'))
     cache_db.remove(self.get_cache_key('otp_cache'))
     Config.clear_cache(self)
示例#4
0
 def clear_cache(self):
     for user in self.iter_users():
         user.clear_cache(org_data=False)
     self.ca_cert.clear_cache(org_data=False)
     cache_db.set_remove('orgs', self.id)
     cache_db.list_remove('orgs_sorted', self.id)
     cache_db.decrement('org_count')
     cache_db.remove(self.get_cache_key('users_cached'))
     cache_db.remove(self.get_cache_key('users'))
     cache_db.remove(self.get_cache_key('user_count'))
     cache_db.remove(self.get_cache_key('users_sorted'))
     cache_db.remove(self.get_cache_key('users_page_index'))
     cache_db.remove(self.get_cache_key('users_page_total'))
     CacheTrie(self.get_cache_key('users_trie')).clear_cache()
     Config.clear_cache(self)