From f5d2cb5c61b4e749dbc4123d66bd84d8514109cb Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 14 May 2018 09:24:49 +0900 Subject: Improve performance --- src/server/api/common/read-notification.ts | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/server/api/common/read-notification.ts') diff --git a/src/server/api/common/read-notification.ts b/src/server/api/common/read-notification.ts index 9bd41519fb..7b9faf4cf4 100644 --- a/src/server/api/common/read-notification.ts +++ b/src/server/api/common/read-notification.ts @@ -43,6 +43,8 @@ export default ( .count({ notifieeId: userId, isRead: false + }, { + limit: 1 }); if (count == 0) { -- cgit v1.2.3-freya