-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Automated Build
committed
Feb 22, 2024
1 parent
2094b8e
commit ef82d88
Showing
227 changed files
with
3,805 additions
and
2,720 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
124 changes: 124 additions & 0 deletions
124
ref-docs/sitecore-jss-angular/classes/DefaultRetryStrategy.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
[@sitecore-jss/sitecore-jss-angular](../README.md) / DefaultRetryStrategy | ||
|
||
# Class: DefaultRetryStrategy | ||
|
||
Represents a default retry strategy for handling retry attempts in case of specific HTTP status codes. | ||
This class implements the RetryStrategy interface and provides methods to determine whether a request | ||
should be retried and calculates the delay before the next retry attempt. | ||
|
||
## Implements | ||
|
||
- [`RetryStrategy`](../interfaces/RetryStrategy.md) | ||
|
||
## Table of contents | ||
|
||
### Constructors | ||
|
||
- [constructor](DefaultRetryStrategy.md#constructor) | ||
|
||
### Properties | ||
|
||
- [factor](DefaultRetryStrategy.md#factor) | ||
- [statusCodes](DefaultRetryStrategy.md#statuscodes) | ||
|
||
### Methods | ||
|
||
- [getDelay](DefaultRetryStrategy.md#getdelay) | ||
- [shouldRetry](DefaultRetryStrategy.md#shouldretry) | ||
|
||
## Constructors | ||
|
||
### constructor | ||
|
||
• **new DefaultRetryStrategy**(`options?`) | ||
|
||
#### Parameters | ||
|
||
| Name | Type | Description | | ||
| :------ | :------ | :------ | | ||
| `options?` | `Object` | Configurable options for retry mechanism. | | ||
| `options.factor?` | `number` | Factor by which the delay increases with each retry attempt | | ||
| `options.statusCodes?` | `number`[] | HTTP status codes to trigger retries on | | ||
|
||
#### Defined in | ||
|
||
sitecore-jss/types/graphql-request-client.d.ts:94 | ||
|
||
## Properties | ||
|
||
### factor | ||
|
||
• `Private` **factor**: `any` | ||
|
||
#### Defined in | ||
|
||
sitecore-jss/types/graphql-request-client.d.ts:88 | ||
|
||
___ | ||
|
||
### statusCodes | ||
|
||
• `Private` **statusCodes**: `any` | ||
|
||
#### Defined in | ||
|
||
sitecore-jss/types/graphql-request-client.d.ts:87 | ||
|
||
## Methods | ||
|
||
### getDelay | ||
|
||
▸ **getDelay**(`error`, `attempt`): `number` | ||
|
||
Calculates the delay (in milliseconds) before the next retry based on the given error and attempt count. | ||
|
||
#### Parameters | ||
|
||
| Name | Type | Description | | ||
| :------ | :------ | :------ | | ||
| `error` | `ClientError` | The error received from the GraphQL request. | | ||
| `attempt` | `number` | The current attempt number. | | ||
|
||
#### Returns | ||
|
||
`number` | ||
|
||
The delay in milliseconds before the next retry. | ||
|
||
#### Implementation of | ||
|
||
[RetryStrategy](../interfaces/RetryStrategy.md).[getDelay](../interfaces/RetryStrategy.md#getdelay) | ||
|
||
#### Defined in | ||
|
||
sitecore-jss/types/graphql-request-client.d.ts:99 | ||
|
||
___ | ||
|
||
### shouldRetry | ||
|
||
▸ **shouldRetry**(`error`, `attempt`, `retries`): `boolean` | ||
|
||
Determines whether a request should be retried based on the given error and attempt count. | ||
|
||
#### Parameters | ||
|
||
| Name | Type | Description | | ||
| :------ | :------ | :------ | | ||
| `error` | `ClientError` | The error received from the GraphQL request. | | ||
| `attempt` | `number` | The current attempt number. | | ||
| `retries` | `number` | The number of retries configured. | | ||
|
||
#### Returns | ||
|
||
`boolean` | ||
|
||
A boolean indicating whether to retry the request. | ||
|
||
#### Implementation of | ||
|
||
[RetryStrategy](../interfaces/RetryStrategy.md).[shouldRetry](../interfaces/RetryStrategy.md#shouldretry) | ||
|
||
#### Defined in | ||
|
||
sitecore-jss/types/graphql-request-client.d.ts:98 |
Oops, something went wrong.