Temp: log API status per fetch in Webmentions
Some checks failed
Deploy / deploy (push) Has been cancelled
Some checks failed
Deploy / deploy (push) Has been cancelled
This commit is contained in:
parent
9ae9e4cf12
commit
a379e65c7a
1 changed files with 2 additions and 0 deletions
|
|
@ -43,8 +43,10 @@ async function fetchMentions(target: string): Promise<WMEntry[]> {
|
||||||
url.searchParams.set('token', token);
|
url.searchParams.set('token', token);
|
||||||
url.searchParams.set('per-page', '100');
|
url.searchParams.set('per-page', '100');
|
||||||
const res = await fetch(url);
|
const res = await fetch(url);
|
||||||
|
console.log(`[Webmentions] fetch ${t.slice(-40)} → ${res.status}`);
|
||||||
if (!res.ok) return [] as WMEntry[];
|
if (!res.ok) return [] as WMEntry[];
|
||||||
const json = (await res.json()) as { children?: WMEntry[] };
|
const json = (await res.json()) as { children?: WMEntry[] };
|
||||||
|
console.log(`[Webmentions] children=${json.children?.length ?? 0}`);
|
||||||
return json.children ?? [];
|
return json.children ?? [];
|
||||||
};
|
};
|
||||||
const [a, b] = await Promise.all([fetchOne(withSlash), fetchOne(withoutSlash)]);
|
const [a, b] = await Promise.all([fetchOne(withSlash), fetchOne(withoutSlash)]);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue