From 5e61c60f85e262421c1655eb6f8a317b88ccb88f Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 19 Mar 2021 18:22:34 +0900 Subject: [PATCH] perf(server): Improver performance --- src/misc/fetch-meta.ts | 2 +- src/server/api/endpoints/i/notifications.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/misc/fetch-meta.ts b/src/misc/fetch-meta.ts index 680cf37a7..e7a945dc9 100644 --- a/src/misc/fetch-meta.ts +++ b/src/misc/fetch-meta.ts @@ -32,4 +32,4 @@ setInterval(() => { fetchMeta(true).then(meta => { cache = meta; }); -}, 5000); +}, 1000 * 10); diff --git a/src/server/api/endpoints/i/notifications.ts b/src/server/api/endpoints/i/notifications.ts index 0e09bc73f..7a423edb8 100644 --- a/src/server/api/endpoints/i/notifications.ts +++ b/src/server/api/endpoints/i/notifications.ts @@ -85,7 +85,9 @@ export default define(meta, async (ps, user) => { const query = makePaginationQuery(Notifications.createQueryBuilder('notification'), ps.sinceId, ps.untilId) .andWhere(`notification.notifieeId = :meId`, { meId: user.id }) - .leftJoinAndSelect('notification.notifier', 'notifier'); + .leftJoinAndSelect('notification.notifier', 'notifier') + .leftJoinAndSelect('notification.note', 'note') + .leftJoinAndSelect('note.user', 'user'); query.andWhere(`notification.notifierId NOT IN (${ mutingQuery.getQuery() })`); query.setParameters(mutingQuery.getParameters());