diff --git a/.github/workflows/test-backend.yml b/.github/workflows/test-backend.yml index 44b6b4ba7e..f1e414dbbc 100644 --- a/.github/workflows/test-backend.yml +++ b/.github/workflows/test-backend.yml @@ -24,7 +24,7 @@ jobs: POSTGRES_DB: test-misskey POSTGRES_HOST_AUTH_METHOD: trust redis: - image: redis:6 + image: redis:7 ports: - 56312:6379 diff --git a/.github/workflows/test-frontend.yml b/.github/workflows/test-frontend.yml index 18c1a31aee..a5505d30d8 100644 --- a/.github/workflows/test-frontend.yml +++ b/.github/workflows/test-frontend.yml @@ -63,7 +63,7 @@ jobs: POSTGRES_DB: test-misskey POSTGRES_HOST_AUTH_METHOD: trust redis: - image: redis:6 + image: redis:7 ports: - 56312:6379 diff --git a/CHANGELOG.md b/CHANGELOG.md index d031d4f85e..e52c4e0d01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,9 @@ ## 13.x.x (unreleased) +### NOTE +- Redis 7.xが必要です + ### General - チャンネルをお気に入りに登録できるように - チャンネルにノートをピン留めできるように @@ -32,6 +35,7 @@ - 「UIのアニメーションを減らす」 (`reduceAnimation`) で猫耳を撫でられなくなります ### Server +- サーバーの全体的なパフォーマンスを向上 - ノート作成時のパフォーマンスを向上 - アンテナのタイムライン取得時のパフォーマンスを向上 - チャンネルのタイムライン取得時のパフォーマンスを向上 diff --git a/packages/backend/src/core/activitypub/models/ApNoteService.ts b/packages/backend/src/core/activitypub/models/ApNoteService.ts index 28bcbc6fab..5ca5f6e843 100644 --- a/packages/backend/src/core/activitypub/models/ApNoteService.ts +++ b/packages/backend/src/core/activitypub/models/ApNoteService.ts @@ -1,5 +1,6 @@ import { forwardRef, Inject, Injectable } from '@nestjs/common'; import promiseLimit from 'promise-limit'; +import { In } from 'typeorm'; import { DI } from '@/di-symbols.js'; import type { PollsRepository, EmojisRepository } from '@/models/index.js'; import type { Config } from '@/config.js'; @@ -341,15 +342,17 @@ export class ApNoteService { if (!tags) return []; const eomjiTags = toArray(tags).filter(isEmoji); + + const existingEmojis = await this.emojisRepository.findBy({ + host, + name: In(eomjiTags.map(tag => tag.name!.replaceAll(':', ''))), + }); return await Promise.all(eomjiTags.map(async tag => { - const name = tag.name!.replace(/^:/, '').replace(/:$/, ''); + const name = tag.name!.replaceAll(':', ''); tag.icon = toSingle(tag.icon); - const exists = await this.emojisRepository.findOneBy({ - host, - name, - }); + const exists = existingEmojis.find(x => x.name === name); if (exists) { if ((tag.updated != null && exists.updatedAt == null)