Example #1
0
File: comment.py Project: CMGS/ymir
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
Example #2
0
File: site.py Project: CMGS/ymir
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