This commit is contained in:
eric
2026-05-19 12:52:04 +00:00
parent bae55ec52c
commit 1d89aa29e0
27 changed files with 251 additions and 92 deletions

View File

@@ -118,11 +118,17 @@ export async function pushYoutubeProChannelsRemote(
let last: Error | null = null;
for (const path of YOUTUBE_PRO_SYNC_PATHS) {
try {
await fetchJson(path, {
const data = await fetchJson<{ neko?: { ok?: boolean; reason?: string; desired?: number; current?: number | string | null } }>(path, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ channels }),
});
if (data.neko?.ok === false) {
const desired = data.neko.desired ? ` desired=${data.neko.desired}` : "";
const current = data.neko.current ? ` current=${data.neko.current}` : "";
last = new Error(`Neko capacity expansion failed:${desired}${current} ${data.neko.reason || "unknown error"}`.trim());
break;
}
return;
} catch (e) {
last = e instanceof Error ? e : new Error(String(e));