fix: startup and funkwhale listening
This commit is contained in:
@@ -80,6 +80,33 @@ const patchSpecs = [
|
||||
throw err;
|
||||
}
|
||||
|
||||
// Update stats cache after sync`,
|
||||
candidates: [
|
||||
"node_modules/@rmdes/indiekit-endpoint-funkwhale/lib/sync.js",
|
||||
"node_modules/@indiekit/indiekit/node_modules/@rmdes/indiekit-endpoint-funkwhale/lib/sync.js",
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "funkwhale-sync-network-error-guard",
|
||||
marker: "Cannot reach Funkwhale instance; skipping sync",
|
||||
oldSnippet: ` throw err;
|
||||
}
|
||||
|
||||
// Update stats cache after sync`,
|
||||
newSnippet: ` const causeCode = String(err?.cause?.code || "");
|
||||
if (
|
||||
/fetch failed/i.test(message) ||
|
||||
/ECONNREFUSED|ENOTFOUND|ETIMEDOUT/.test(causeCode)
|
||||
) {
|
||||
// Cannot reach Funkwhale instance; skipping sync
|
||||
console.warn(
|
||||
"[Funkwhale] Cannot reach Funkwhale instance; skipping sync. Check FUNKWHALE_INSTANCE is reachable."
|
||||
);
|
||||
return { synced: 0, error: "Network error" };
|
||||
}
|
||||
throw err;
|
||||
}
|
||||
|
||||
// Update stats cache after sync`,
|
||||
candidates: [
|
||||
"node_modules/@rmdes/indiekit-endpoint-funkwhale/lib/sync.js",
|
||||
|
||||
Reference in New Issue
Block a user