tasks.py 文件源码

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

项目:videofront 作者: openfun 项目源码 文件源码
def release_lock(name):
    """
    Release a lock for all. Note that the lock will be released even if it was
    never acquired.
    """
    # Note that in unit tests, and in case the wrapped code raises an
    # IntegrityError, releasing the cache will result in a
    # TransactionManagementError. This is because unit tests run inside atomic
    # blocks. We cannot execute queries inside an atomic block if a transaction
    # needs to be rollbacked.
    try:
        cache.delete(name)
    except TransactionManagementError:
        logger.error("Could not release lock %s", name)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号