s
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user