gpt4 book ai didi

asp.net-core - 核心的 DocumentDB TransientFaultHandling

转载 作者:行者123 更新时间:2023-12-05 00:15:59 26 4
gpt4 key购买 nike

我正在尝试将我的代码迁移到 Core。

我正在使用 DocumentDB TransientFaultHandling 包,但我似乎无法为核心库找到它。

使用它仍然是最佳实践,还是有其他选择可以实现相同的结果?

TIA

最佳答案

当前的 SDK(核心和完整框架)已经包含作为 TransientFaultHandling 包一部分的故障处理,不完全相同,因为您无法定义指数逻辑,但它适用于最常见的场景。

它在 ConnectionPolicy 上设置:

var _dbClient = new DocumentClient("Db_uri", "Db_key", new ConnectionPolicy()
{
MaxConnectionLimit=100,
ConnectionMode = ConnectionMode.Direct,
ConnectionProtocol = Protocol.Tcp,
RetryOptions = new RetryOptions() { MaxRetryAttemptsOnThrottledRequests=3, MaxRetryWaitTimeInSeconds=60 }
});

关于asp.net-core - 核心的 DocumentDB TransientFaultHandling,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43261193/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com