Merge branch 'misskey-dev:develop' into notes-embed

This commit is contained in:
kakkokari-gtyih 2023-04-06 10:38:29 +09:00 committed by GitHub
commit 5d4e987a4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 7 deletions

View File

@ -24,7 +24,7 @@ jobs:
POSTGRES_DB: test-misskey POSTGRES_DB: test-misskey
POSTGRES_HOST_AUTH_METHOD: trust POSTGRES_HOST_AUTH_METHOD: trust
redis: redis:
image: redis:6 image: redis:7
ports: ports:
- 56312:6379 - 56312:6379

View File

@ -63,7 +63,7 @@ jobs:
POSTGRES_DB: test-misskey POSTGRES_DB: test-misskey
POSTGRES_HOST_AUTH_METHOD: trust POSTGRES_HOST_AUTH_METHOD: trust
redis: redis:
image: redis:6 image: redis:7
ports: ports:
- 56312:6379 - 56312:6379

View File

@ -14,6 +14,9 @@
## 13.x.x (unreleased) ## 13.x.x (unreleased)
### NOTE
- Redis 7.xが必要です
### General ### General
- チャンネルをお気に入りに登録できるように - チャンネルをお気に入りに登録できるように
- チャンネルにノートをピン留めできるように - チャンネルにノートをピン留めできるように
@ -32,6 +35,7 @@
- 「UIのアニメーションを減らす」 (`reduceAnimation`) で猫耳を撫でられなくなります - 「UIのアニメーションを減らす」 (`reduceAnimation`) で猫耳を撫でられなくなります
### Server ### Server
- サーバーの全体的なパフォーマンスを向上
- ノート作成時のパフォーマンスを向上 - ノート作成時のパフォーマンスを向上
- アンテナのタイムライン取得時のパフォーマンスを向上 - アンテナのタイムライン取得時のパフォーマンスを向上
- チャンネルのタイムライン取得時のパフォーマンスを向上 - チャンネルのタイムライン取得時のパフォーマンスを向上

View File

@ -1,5 +1,6 @@
import { forwardRef, Inject, Injectable } from '@nestjs/common'; import { forwardRef, Inject, Injectable } from '@nestjs/common';
import promiseLimit from 'promise-limit'; import promiseLimit from 'promise-limit';
import { In } from 'typeorm';
import { DI } from '@/di-symbols.js'; import { DI } from '@/di-symbols.js';
import type { PollsRepository, EmojisRepository } from '@/models/index.js'; import type { PollsRepository, EmojisRepository } from '@/models/index.js';
import type { Config } from '@/config.js'; import type { Config } from '@/config.js';
@ -341,15 +342,17 @@ export class ApNoteService {
if (!tags) return []; if (!tags) return [];
const eomjiTags = toArray(tags).filter(isEmoji); 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 => { return await Promise.all(eomjiTags.map(async tag => {
const name = tag.name!.replace(/^:/, '').replace(/:$/, ''); const name = tag.name!.replaceAll(':', '');
tag.icon = toSingle(tag.icon); tag.icon = toSingle(tag.icon);
const exists = await this.emojisRepository.findOneBy({ const exists = existingEmojis.find(x => x.name === name);
host,
name,
});
if (exists) { if (exists) {
if ((tag.updated != null && exists.updatedAt == null) if ((tag.updated != null && exists.updatedAt == null)