track.py 文件源码

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

项目:zappa-bittorrent-tracker 作者: Miserlou 项目源码 文件源码
def remove_peer_from_info_hash_dynamo(
                            info_hash, 
                            peer_id, 
                        ):

    ensure_torrent_exists(info_hash)

    # Update the torrents list with the new information
    result = table.update_item(
        Key={
            'info_hash': info_hash,
        },
        UpdateExpression="REMOVE peers.#s",
        ExpressionAttributeNames={
            '#s': peer_id,
        },
        ReturnValues="UPDATED_NEW"
    )

    if result['ResponseMetadata']['HTTPStatusCode'] == 200 and 'Attributes' in result:
        return True
    return False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号