summaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-05-14 09:24:49 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-05-14 09:24:49 +0900
commitf5d2cb5c61b4e749dbc4123d66bd84d8514109cb (patch)
treeef2a7eaaeeb52608d69e8c79e4b4accb22549119 /src/server
parent2.6.1 (diff)
downloadsharkey-f5d2cb5c61b4e749dbc4123d66bd84d8514109cb.tar.gz
sharkey-f5d2cb5c61b4e749dbc4123d66bd84d8514109cb.tar.bz2
sharkey-f5d2cb5c61b4e749dbc4123d66bd84d8514109cb.zip
Improve performance
Diffstat (limited to 'src/server')
-rw-r--r--src/server/api/common/read-messaging-message.ts2
-rw-r--r--src/server/api/common/read-notification.ts2
2 files changed, 4 insertions, 0 deletions
diff --git a/src/server/api/common/read-messaging-message.ts b/src/server/api/common/read-messaging-message.ts
index c52f9363b5..28854e186e 100644
--- a/src/server/api/common/read-messaging-message.ts
+++ b/src/server/api/common/read-messaging-message.ts
@@ -57,6 +57,8 @@ export default (
.count({
recipientId: userId,
isRead: false
+ }, {
+ limit: 1
});
if (count == 0) {
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) {