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
评论列表
文章目录