Skip to content

Commit

Permalink
Final PR comment actions
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Whitehead <[email protected]>
  • Loading branch information
matthew1001 committed Mar 29, 2023
1 parent 79d012f commit 0982c00
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,5 @@ The configurable retry settings are:
- `RETRY_MAX_ATTEMPTS` (default `15`)

Setting `RETRY_CONDITION` to `""` disables retries. Setting `RETRY_MAX_ATTEMPTS` to `-1` causes it to retry indefinitely.

Note, the token connector will make a total of `RETRY_MAX_ATTEMPTS` + 1 calls for a given retryable call (1 original attempt and `RETRY_MAX_ATTEMPTS` retries)
8 changes: 4 additions & 4 deletions src/tokens/blockchain.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export class BlockchainConnectorService {
private matchesRetryCondition(err: any): boolean {
return (
this.retryConfiguration.retryCondition != '' &&
err?.toString().match(this.retryConfiguration.retryCondition) !== null
`${err}`.match(this.retryConfiguration.retryCondition) !== null
);
}

Expand Down Expand Up @@ -153,7 +153,7 @@ export class BlockchainConnectorService {
const url = this.baseUrl;
const response = await this.wrapError(
this.retryableCall<EthConnectReturn>(async (): Promise<AxiosResponse<EthConnectReturn>> => {
return await lastValueFrom(
return lastValueFrom(
this.http.post(
url,
{ headers: { type: queryHeader }, to, method, params },
Expand All @@ -178,7 +178,7 @@ export class BlockchainConnectorService {
const response = await this.wrapError(
this.retryableCall<EthConnectAsyncResponse>(
async (): Promise<AxiosResponse<EthConnectAsyncResponse>> => {
return await lastValueFrom(
return lastValueFrom(
this.http.post(
url,
{ headers: { id, type: sendTransactionHeader }, from, to, method, params },
Expand All @@ -195,7 +195,7 @@ export class BlockchainConnectorService {
const url = this.baseUrl;
const response = await this.wrapError(
this.retryableCall<EventStreamReply>(async (): Promise<AxiosResponse<EventStreamReply>> => {
return await lastValueFrom(
return lastValueFrom(
this.http.get(new URL(`/reply/${id}`, url).href, {
validateStatus: status => status < 300 || status === 404,
...this.requestOptions(ctx),
Expand Down

0 comments on commit 0982c00

Please sign in to comment.