mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-07 05:37:35 +02:00
fix: skip AP cache on context processing methods
This commit is contained in:
@@ -25,7 +25,7 @@ Contexts.get = async (uid, id) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
({ id, type, context } = await activitypub.get('uid', uid, id, { headers }));
|
({ id, type, context } = await activitypub.get('uid', uid, id, { headers, cache: false }));
|
||||||
if (activitypub._constants.acceptable.contextTypes.has(type)) { // is context
|
if (activitypub._constants.acceptable.contextTypes.has(type)) { // is context
|
||||||
activitypub.helpers.log(`[activitypub/context] ${id} is the context.`);
|
activitypub.helpers.log(`[activitypub/context] ${id} is the context.`);
|
||||||
return { context: id };
|
return { context: id };
|
||||||
@@ -35,7 +35,7 @@ Contexts.get = async (uid, id) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// context provided; try to resolve it.
|
// context provided; try to resolve it.
|
||||||
({ type } = await activitypub.get('uid', uid, context));
|
({ type } = await activitypub.get('uid', uid, context, { cache: false }));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e.code === 'ap_get_304') {
|
if (e.code === 'ap_get_304') {
|
||||||
activitypub.helpers.log(`[activitypub/context] ${id} context unchanged.`);
|
activitypub.helpers.log(`[activitypub/context] ${id} context unchanged.`);
|
||||||
@@ -65,7 +65,7 @@ Contexts.getItems = async (uid, id, options) => {
|
|||||||
} else {
|
} else {
|
||||||
activitypub.helpers.log(`[activitypub/context] Retrieving context/page ${id}`);
|
activitypub.helpers.log(`[activitypub/context] Retrieving context/page ${id}`);
|
||||||
try {
|
try {
|
||||||
object = await activitypub.get('uid', uid, id);
|
object = await activitypub.get('uid', uid, id, { cache: false });
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user