Родитель
259d5a2809
Коммит
7b7afb35de
|
@ -36,13 +36,17 @@ export class EndpointDiscoveryRetryPolicy implements IRetryPolicy {
|
||||||
*/
|
*/
|
||||||
public async shouldRetry(
|
public async shouldRetry(
|
||||||
err: ErrorResponse,
|
err: ErrorResponse,
|
||||||
retryContext: RetryContext,
|
retryContext?: RetryContext,
|
||||||
locationEndpoint: string
|
locationEndpoint?: string
|
||||||
): Promise<boolean | [boolean, string]> {
|
): Promise<boolean | [boolean, string]> {
|
||||||
if (!err) {
|
if (!err) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!retryContext || !locationEndpoint) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (!this.globalEndpointManager.enableEndpointDiscovery) {
|
if (!this.globalEndpointManager.enableEndpointDiscovery) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,11 +34,15 @@ export class SessionRetryPolicy implements IRetryPolicy {
|
||||||
* @param {function} callback - The callback function which takes bool argument which specifies whether the request\
|
* @param {function} callback - The callback function which takes bool argument which specifies whether the request\
|
||||||
* will be retried or not.
|
* will be retried or not.
|
||||||
*/
|
*/
|
||||||
public async shouldRetry(err: ErrorResponse, retryContext: RetryContext): Promise<boolean> {
|
public async shouldRetry(err: ErrorResponse, retryContext?: RetryContext): Promise<boolean> {
|
||||||
if (!err) {
|
if (!err) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!retryContext) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (!this.connectionPolicy.EnableEndpointDiscovery) {
|
if (!this.connectionPolicy.EnableEndpointDiscovery) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче