Skip to content

Commit

Permalink
remove http request timeout on api
Browse files Browse the repository at this point in the history
  • Loading branch information
barnjamin committed Dec 28, 2023
1 parent bac10b0 commit 26affc3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion connect/src/circle-api.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import axios from "axios";
import { CIRCLE_RETRY_INTERVAL } from "./config";
import { retry } from "./tasks";

// Note: mostly ripped off from https://github.com/circlefin/cctp-sample-app/blob/master/src/services/attestationService.ts
export const CIRCLE_RETRY_INTERVAL = 2000;

export enum CircleAttestationStatus {
complete = "complete",
Expand Down
3 changes: 0 additions & 3 deletions connect/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ import { buildConfig, ChainsConfig } from "@wormhole-foundation/sdk-definitions"

export const DEFAULT_TASK_TIMEOUT = 60 * 1000; // 1 minute in milliseconds

export const CIRCLE_RETRY_INTERVAL = 2000;
export const WHSCAN_RETRY_INTERVAL = 2000;

export type WormholeConfig<N extends Network = Network, P extends Platform = Platform> = {
api: string;
circleAPI: string;
Expand Down
7 changes: 3 additions & 4 deletions connect/src/whscan-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ import {
deserialize,
} from "@wormhole-foundation/sdk-definitions";
import axios from "axios";
import { WHSCAN_RETRY_INTERVAL } from "./config";
import { retry } from "./tasks";

export const WHSCAN_RETRY_INTERVAL = 2000;

// TransactionStatus returned by wormholescan
export interface TransactionStatus {
id: string;
Expand Down Expand Up @@ -136,9 +137,7 @@ export async function getVaaBytes(
try {
const {
data: { vaaBytes },
} = await axios.get<{ vaaBytes: string }>(url, {
timeout: 2000,
});
} = await axios.get<{ vaaBytes: string }>(url);
return encoding.b64.decode(vaaBytes);
} catch (error) {
if (!error) return null;
Expand Down

0 comments on commit 26affc3

Please sign in to comment.