perf(server): use cached user info in getUserFromApId

This commit is contained in:
syuilo 2022-03-26 19:09:57 +09:00
parent 8cbfc047bb
commit 17589843da
5 changed files with 38 additions and 13 deletions

View file

@ -4,11 +4,11 @@ import renderAccept from '@/remote/activitypub/renderer/accept.js';
import { deliver } from '@/queue/index.js';
import { publishMainStream } from '@/services/stream.js';
import { insertFollowingDoc } from '../create.js';
import { User, ILocalUser } from '@/models/entities/user.js';
import { User, ILocalUser, CacheableUser } from '@/models/entities/user.js';
import { FollowRequests, Users } from '@/models/index.js';
import { IdentifiableError } from '@/misc/identifiable-error.js';
export default async function(followee: { id: User['id']; host: User['host']; uri: User['host']; inbox: User['inbox']; sharedInbox: User['sharedInbox']; }, follower: User) {
export default async function(followee: { id: User['id']; host: User['host']; uri: User['host']; inbox: User['inbox']; sharedInbox: User['sharedInbox']; }, follower: CacheableUser) {
const request = await FollowRequests.findOneBy({
followeeId: followee.id,
followerId: follower.id,