Fix unfurl timeout
This commit is contained in:
parent
b9fc663db4
commit
54481ab96b
|
@ -217,7 +217,10 @@ interface PreviewCard {
|
|||
async function unfurlCard(url: string): Promise<PreviewCard | null> {
|
||||
console.log(`Unfurling ${url}...`);
|
||||
try {
|
||||
const result = await unfurl(url, { fetch, follow: 2, timeout: Time.seconds(1), size: 1024 * 1024 });
|
||||
const result = await unfurl(url, {
|
||||
fetch: (url) => fetch(url, { signal: AbortSignal.timeout(Time.seconds(1)) }),
|
||||
});
|
||||
|
||||
return {
|
||||
type: result.oEmbed?.type || 'link',
|
||||
url: result.canonical_url || url,
|
||||
|
|
Loading…
Reference in New Issue