Harden async task flows and enhance analysis tooling

这个提交包含在:
cryptocommuniums-afk
2026-03-15 08:05:37 +08:00
父节点 585fd5773d
当前提交 cb643ac154
修改 14 个文件,包含 566 行新增33 行删除

查看文件

@@ -1,4 +1,5 @@
import { ENV } from "./_core/env";
import { fetchWithTimeout } from "./_core/fetch";
export type RemoteMediaSession = {
id: string;
@@ -35,7 +36,11 @@ export async function getRemoteMediaSession(sessionId: string) {
let lastError: Error | null = null;
for (const url of getMediaCandidateUrls(`/sessions/${encodeURIComponent(sessionId)}`)) {
const response = await fetch(url);
const response = await fetchWithTimeout(url, undefined, {
timeoutMs: ENV.mediaFetchTimeoutMs,
retries: ENV.mediaFetchRetryCount,
retryMethods: ["GET"],
});
if (response.ok) {
const payload = await response.json() as { session: RemoteMediaSession };
return payload.session;