feat: basic retry queue

This commit is contained in:
Opliko
2024-05-06 22:49:31 +02:00
parent 4e7b12b925
commit 50bc9a37c5
2 changed files with 47 additions and 22 deletions

View File

@@ -412,3 +412,14 @@ inbox.flag = async (req) => {
}
}));
};
inbox.reject = async (req) => {
const { actor, object } = req.body;
const { type, id } = object;
const { hostname } = new URL(actor);
const queueId = `${type}:${id}:${hostname}`;
// stop retrying rejected requests
clearTimeout(activitypub.retryQueue.get(queueId));
activitypub.retryQueue.delete(queueId);
};