Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const WAIT_CONDITION_INITIAL_INTERVAL = 1000;
export const WAIT_CONDITION_MAX_INTERVAL = 10000;
export const EMAIL_INITIAL_WAIT = 5000;
export const EMAIL_RETRY_DELAY = 60000;
export const EMAIL_FETCH_TIMEOUT = 30000;

// Limits
export const STEP_EXECUTION_MAX_STEPS = 25;
Expand Down
5 changes: 4 additions & 1 deletion src/providers/emailsink.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { EmailProvider } from "../config";
import { EMAIL_FETCH_TIMEOUT } from "../constants";

/**
* Emailsink is a simple email service by Bug0 that allows you to receive emails at a unique address and retrieve their content via an API
Expand All @@ -15,7 +16,9 @@ export function emailsinkProvider(options: { apiKey?: string }): EmailProvider {
if (options.apiKey) {
url += `&secret=${encodeURIComponent(options.apiKey)}`;
}
const response = await fetch(url);
const response = await fetch(url, {
signal: AbortSignal.timeout(EMAIL_FETCH_TIMEOUT),
});
const data = (await response.json()) as { result: string | undefined };

let result = data.result;
Expand Down