forked from FoundKeyGang/FoundKey
server: try to fix queue errors
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:
parent
0cb4529ed0
commit
37658f5162
1 changed files with 8 additions and 6 deletions
|
@ -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';
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue