perf(server): refactor and performance improvements

This commit is contained in:
syuilo 2022-03-25 16:27:41 +09:00
parent 22b56ac65c
commit ac8c66f5ab
71 changed files with 289 additions and 189 deletions

View file

@ -20,7 +20,7 @@ import { Brackets, In } from 'typeorm';
* @param user 稿
* @param note 稿
*/
export default async function(user: User, note: Note, quiet = false) {
export default async function(user: { id: User['id']; uri: User['uri']; host: User['host']; }, note: Note, quiet = false) {
const deletedAt = new Date();
// この投稿を除く指定したユーザーによる指定したノートのリノートが存在しないとき
@ -131,7 +131,7 @@ async function getMentionedRemoteUsers(note: Note) {
}) as IRemoteUser[];
}
async function deliverToConcerned(user: ILocalUser, note: Note, content: any) {
async function deliverToConcerned(user: { id: ILocalUser['id']; host: null; }, note: Note, content: any) {
deliverToFollowers(user, content);
deliverToRelays(user, content);
const remoteUsers = await getMentionedRemoteUsers(note);