mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-05 05:25:49 +01:00
fix: move AP send logging earlier
This commit is contained in:
@@ -337,11 +337,6 @@ async function sendMessage(uri, id, type, payload, attempts = 1) {
|
||||
const keyData = await ActivityPub.getPrivateKey(type, id);
|
||||
const headers = await ActivityPub.sign(keyData, uri, payload);
|
||||
|
||||
ActivityPub.helpers.log(`[activitypub/send] ${uri}`);
|
||||
if (process.env.hasOwnProperty('CI')) {
|
||||
ActivityPub._sent.set(payload.id, payload);
|
||||
}
|
||||
|
||||
try {
|
||||
const { response, body } = await request.post(uri, {
|
||||
headers: {
|
||||
@@ -381,6 +376,11 @@ ActivityPub.send = async (type, id, targets, payload) => {
|
||||
return ActivityPub.helpers.log('[activitypub/send] Federation not enabled; not sending.');
|
||||
}
|
||||
|
||||
ActivityPub.helpers.log(`[activitypub/send] ${payload.id}`);
|
||||
if (process.env.hasOwnProperty('CI')) {
|
||||
ActivityPub._sent.set(payload.id, payload);
|
||||
}
|
||||
|
||||
if (!Array.isArray(targets)) {
|
||||
targets = [targets];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user