def get_table(sid, token, node): comment_table = local_cache.get(config.COMMENT_TABLE_PREFIX.format(token = token), None) if not comment_table: comment_table = generate(sid, token, node) return comment_table
def get_site_by_token(token): site = local_cache.get(token, None) if not site: site = Site.select().where(Site.token == token).first() local_cache[token] = site return site