Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
penginn-net committed Dec 7, 2024
1 parent e2e6706 commit 165f60b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,14 @@ export class ApOutboxFetchService implements OnModuleInit {
if (collection.partOf !== user.outbox) throw new IdentifiableError('6603433f-99db-4134-980c-48705ae57ab8', 'outbox part is invalid');

const activityes = (collection.orderedItems ?? collection.items);
if (!activityes) throw new IdentifiableError('2a05bb06-f38c-4854-af6f-7fd5e87c98ee', 'item is undefined');
if (!activityes) throw new IdentifiableError('2a05bb06-f38c-4854-af6f-7fd5e87c98ee', 'item is unavailable');

created = await this.fetchObjects(user, activityes, includeAnnounce, created);
if (createLimit <= created) break;//次ページ見て一件だけしか取れないのは微妙
if (!collection.next) break;

await this.redisClient.set(`${outboxUrl}--next`, `${collection.next}`, 'EX', 60 * 15);//15min
next = collection.next;
await this.redisClient.set(`${outboxUrl}--next`, `${next}`, 'EX', 60 * 15);//15min
}
this.logger.succ(`Outbox Fetced: ${outboxUrl}`);
}
Expand Down Expand Up @@ -176,7 +177,7 @@ export class ApOutboxFetchService implements OnModuleInit {
}
} else if (isCreate(activity)) {
if (typeof(activity.object) !== 'string') {
if (!isNote(activity)) throw new IdentifiableError('9e344117-8392-402d-9f5a-d1cc20ba63cc');
if (!isNote(activity)) continue;
}
const fetch = await this.apNoteService.fetchNote(activity.object);
if (fetch) continue;
Expand All @@ -186,7 +187,6 @@ export class ApOutboxFetchService implements OnModuleInit {
//リモートのリモートが落ちてるなどで止まるとほかが見れなくなってしまうので再スローしない
if (err instanceof IdentifiableError) {
if (err.id === 'bde7c204-5441-4a87-9b7e-f81e8d05788a') this.logger.error(`fetchErrorInvalidActor:${activity.id}`);
if (err.id === '9e344117-8392-402d-9f5a-d1cc20ba63cc') this.logger.error(`fetchErrorNotNote:${activity.id}`);
} else {
this.logger.error(`fetchError:${activity.id}`);
this.logger.error(`${err}`);
Expand Down
4 changes: 2 additions & 2 deletions packages/backend/src/server/api/endpoints/ap/fetch-outbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ export const meta = {
id: 'c3e584df-068a-4b1d-967e-54f2f30f7cba',
},
itemIsUndefined: {
message: 'outbox item is undefined',
code: 'OUTBOX_ITEM_IS_UNDEFINED',
message: 'outbox item is unavailable',
code: 'OUTBOX_ITEM_IS_UNAVAILABLE',
id: 'a07b05af-5f66-4203-918c-ebff9e9384bf',
},
},
Expand Down

0 comments on commit 165f60b

Please sign in to comment.