server: try to fix queue errors
ci/woodpecker/push/lint-client Pipeline failed Details
ci/woodpecker/push/lint-sw Pipeline failed Details
ci/woodpecker/push/lint-foundkey-js Pipeline was successful Details
ci/woodpecker/push/lint-backend Pipeline failed Details
ci/woodpecker/push/build Pipeline was successful Details
ci/woodpecker/push/test Pipeline failed Details

Some errors in the queue are not properly handled. For example a blocked instance
will cause the respective queue job to be retried. this should of course not happen
and instead the job should be dropped. This is trying to correct that.

Changelog: Fixed
This commit is contained in:
Johann150 2023-09-24 16:29:27 +02:00
parent 0cb4529ed0
commit 37658f5162
Signed by: Johann150
GPG Key ID: 9EE6577A2A06F8F1
1 changed files with 8 additions and 6 deletions

View File

@ -41,13 +41,15 @@ export default async (job: Bull.Job<InboxJobData>): Promise<string> => {
return `skip: unsupported LD-signature type ${activity.signature.type}`;
}
// get user based on LD-Signature key id.
// lets assume that the creator has this common form:
// <https://example.com/users/user#main-key>
// Then we can use it as the key id and (without fragment part) user id.
authUser = await getAuthUser(activity.signature.creator, activity.signature.creator.replace(/#.*$/, ''), resolver);
try {
// get user based on LD-Signature key id.
// lets assume that the creator has this common form:
// <https://example.com/users/user#main-key>
// Then we can use it as the key id and (without fragment part) user id.
authUser = await getAuthUser(activity.signature.creator, activity.signature.creator.replace(/#.*$/, ''), resolver);
if (authUser == null) {
if (authUser == null) throw new Error();
} catch {
return 'skip: failed to resolve LD-Signature user';
}