fix: raise probe timeout to 2s

This commit is contained in:
Julian Lam
2024-10-30 16:07:34 -04:00
parent dd3634462f
commit 94e3490711
3 changed files with 3 additions and 3 deletions

View File

@@ -194,7 +194,7 @@
"activitypubEnabled": 1, "activitypubEnabled": 1,
"activitypubAllowLoopback": 0, "activitypubAllowLoopback": 0,
"activitypubProbe": 1, "activitypubProbe": 1,
"activitypubProbeTimeout": 500, "activitypubProbeTimeout": 2000,
"activitypubContentPruneDays": 30, "activitypubContentPruneDays": 30,
"activitypubUserPruneDays": 7, "activitypubUserPruneDays": 7,
"activitypubFilter": 0 "activitypubFilter": 0

View File

@@ -16,7 +16,7 @@
"probe-enabled": "Try to open ActivityPub-enabled resources in NodeBB", "probe-enabled": "Try to open ActivityPub-enabled resources in NodeBB",
"probe-enabled-help": "If enabled, NodeBB will check every external link for an ActivityPub equivalent, and load it in NodeBB instead.", "probe-enabled-help": "If enabled, NodeBB will check every external link for an ActivityPub equivalent, and load it in NodeBB instead.",
"probe-timeout": "Lookup Timeout (milliseconds)", "probe-timeout": "Lookup Timeout (milliseconds)",
"probe-timeout-help": "(Default: 500) If the lookup query does not receive a response within the set timeframe, will send the user to the link directly instead. Adjust this number higher if sites are responding slowly and you wish to give extra time.", "probe-timeout-help": "(Default: 2000) If the lookup query does not receive a response within the set timeframe, will send the user to the link directly instead. Adjust this number higher if sites are responding slowly and you wish to give extra time.",
"server-filtering": "Filtering", "server-filtering": "Filtering",
"count": "This NodeBB is currently aware of <strong>%1</strong> server(s)", "count": "This NodeBB is currently aware of <strong>%1</strong> server(s)",

View File

@@ -515,7 +515,7 @@ ActivityPub.probe = async ({ uid, url }) => {
return false; return false;
} }
try { try {
await checkHeader(meta.config.activitypubProbeTimeout || 500); await checkHeader(meta.config.activitypubProbeTimeout || 2000);
} catch (e) { } catch (e) {
if (e.name === 'TimeoutError') { if (e.name === 'TimeoutError') {
// Return early but retry for caching purposes // Return early but retry for caching purposes