diff --git a/CHANGELOG.md b/CHANGELOG.md index 604e7219d8c18a83d23bbe56b422d4ac5ddc8bc8..0f4b5b47d09116157bb30ee904f4c8dd6ba0a8bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ * Fixed pseudocode not rendering properly due to element `p` overflow setting. * Added the ability for the `git-heatmap` to combine activity from multiple sources. +* Fixed `DEADLINE_EXCEEDED` error which occasionally occured when calling + sendNote. ## 2.1.0 diff --git a/api/activitypub/sendNote.ts b/api/activitypub/sendNote.ts index 0315a3207cd4dbc8f0869964d9a40517aa3b970c..86f0579be8dffc729c7479c571cedb1d7dcca0e7 100644 --- a/api/activitypub/sendNote.ts +++ b/api/activitypub/sendNote.ts @@ -5,6 +5,8 @@ import { OrderedCollection } from 'activitypub-core-types/lib/activitypub/index. import { sendSignedRequest } from '../../lib/activitypub/utils/sendSignedRequest.js'; import { fetchActorInformation } from '../../lib/activitypub/utils/fetchActorInformation.js'; +export const maxDuration = 300; // This function can run for a maximum of 5 minutes + process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; if (!admin.default.apps.length) { @@ -120,7 +122,7 @@ export default async function (req: VercelRequest, res: VercelResponse) { configRef.set({ "sentIds": newSentIds, "lastEpoch": new Date().getTime() - }); + }).then(result => response.status(200)); console.log("sendNode successful", sentIds, sendingIds, newSentIds);