共用方式為


ExponentialRetry 類別

指數重試。

建構指數重試物件。 第一次重試會使用initial_backoff。 後續重試會在 initial_backoff + increment_power^retry_count 秒之後重試。

繼承
azure.storage.filedatalake._shared.policies.StorageRetryPolicy
ExponentialRetry

建構函式

ExponentialRetry(initial_backoff=15, increment_base=3, retry_total=3, retry_to_secondary=False, random_jitter_range=3, **kwargs)

參數

名稱 Description
initial_backoff
int

第一次重試的初始輪詢間隔,以秒為單位。

預設值: 15
increment_base
int

第一次重試之後,以秒為單位的基底,以遞增initial_backoff。

預設值: 3
max_attempts
必要
int

重試嘗試的次數上限。

retry_to_secondary

如果能夠,是否應將要求重試至次要。 這應該只啟用 RA-GRS 帳戶的使用,而且可能會處理過時的資料。

預設值: False
random_jitter_range
int

以秒為單位的數位,表示要針對退班間隔進行抖動/隨機化的範圍。 例如,random_jitter_range 3 會導致退班間隔 x 在 x+3 和 x-3 之間有所不同。

預設值: 3
retry_total
預設值: 3

方法

configure_retries
get_backoff_time

計算重試前的睡眠時間長度。

increment

遞增重試計數器。

send
sleep

configure_retries

configure_retries(request)

參數

名稱 Description
request
必要

get_backoff_time

計算重試前的睡眠時間長度。

get_backoff_time(settings)

參數

名稱 Description
settings
必要

與輪詢時間相關的可設定值。

傳回

類型 Description
int,

整數,指出重試要求之前要等候的時間長度,或 [無] 表示不應該執行重試。

increment

遞增重試計數器。

increment(settings, request, response=None, error=None)

參數

名稱 Description
settings
必要

與遞增作業相關的可設定值。

request
必要
<xref:<xref:"PipelineRequest">>

管線要求物件。

"PipelineResponse"
必要

管線回應物件。

error

要求期間發生錯誤,如果成功收到回應,則為 None。

預設值: None
response
預設值: None

傳回

類型 Description

重試嘗試是否耗盡。

send

send(request)

參數

名稱 Description
request
必要

sleep

sleep(settings, transport)

參數

名稱 Description
settings
必要
transport
必要

屬性

next

下一個原則的指標,或包裝為原則) 的傳輸 (。 將會在管線建立時設定。

next: HTTPPolicy[HTTPRequestType, HTTPResponseType]