summaryrefslogtreecommitdiff
path: root/packages/backend/src
diff options
context:
space:
mode:
authorHazelnoot <acomputerdog@gmail.com>2025-03-30 01:24:11 -0400
committerHazelnoot <acomputerdog@gmail.com>2025-06-06 22:20:16 -0400
commitfac3e8df5b2ec46b408e11fe5394be260a4ffaa4 (patch)
treee0864ad8836eaecb7dcb35d533a35061c387a10d /packages/backend/src
parentsuppress large error messages from Got (diff)
downloadsharkey-fac3e8df5b2ec46b408e11fe5394be260a4ffaa4.tar.gz
sharkey-fac3e8df5b2ec46b408e11fe5394be260a4ffaa4.tar.bz2
sharkey-fac3e8df5b2ec46b408e11fe5394be260a4ffaa4.zip
avoid "unhandled rejection" errors from updatePerson
Diffstat (limited to 'packages/backend/src')
-rw-r--r--packages/backend/src/core/activitypub/ApInboxService.ts9
1 files changed, 6 insertions, 3 deletions
diff --git a/packages/backend/src/core/activitypub/ApInboxService.ts b/packages/backend/src/core/activitypub/ApInboxService.ts
index f4208b6e93..f240ddb819 100644
--- a/packages/backend/src/core/activitypub/ApInboxService.ts
+++ b/packages/backend/src/core/activitypub/ApInboxService.ts
@@ -148,7 +148,8 @@ export class ApInboxService {
if (actor.lastFetchedAt == null || Date.now() - actor.lastFetchedAt.getTime() > 1000 * 60 * 60 * 24) {
setImmediate(() => {
// 同一ユーザーの情報を再度処理するので、使用済みのresolverを再利用してはいけない
- this.apPersonService.updatePerson(actor.uri);
+ this.apPersonService.updatePerson(actor.uri)
+ .catch(err => this.logger.error(`Failed to update person: ${renderInlineError(err)}`));
});
}
}
@@ -443,9 +444,11 @@ export class ApInboxService {
setImmediate(() => {
// Don't re-use the resolver, or it may throw recursion errors.
// Instead, create a new resolver with an appropriately-reduced recursion limit.
- this.apPersonService.updatePerson(actor.uri, this.apResolverService.createResolver({
+ const subResolver = this.apResolverService.createResolver({
recursionLimit: resolver.getRecursionLimit() - resolver.getHistory().length,
- }));
+ });
+ this.apPersonService.updatePerson(actor.uri, subResolver)
+ .catch(err => this.logger.error(`Failed to update person: ${renderInlineError(err)}`));
});
}
});