memory.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:infoset-ng 作者: PalisadoesFoundation 项目源码 文件源码
def flask_cache_key(*args, **kwargs):
    """Create a key for use by Flask-Caching.

    Args:
        None

    Returns:
        result: Key to be used

    """
    # Use the request URI as part of the key
    path = request.path

    # This helps to differentiate between various instances of infoset
    # each running on different ports
    server_port = request.environ['SERVER_PORT']

    # Use a hash of the request arguments as part of the key
    args = str(hash(frozenset(request.args.items())))

    # Return
    result = (
        'infoset_flask_{}_{}_{}'.format(
            path, server_port, args)[:255].encode('utf-8'))
    return result
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号