From 763676a18c894b9499aeecb91747681d3b856062 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 9 Jun 2018 10:12:03 +0900 Subject: [PATCH] :v: --- src/notes-stats-child.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/notes-stats-child.ts b/src/notes-stats-child.ts index 0e0f14eaf1..5f85a2a3cc 100644 --- a/src/notes-stats-child.ts +++ b/src/notes-stats-child.ts @@ -1,13 +1,15 @@ import Note from './models/note'; +const interval = 5000; + setInterval(async () => { const [all, local] = await Promise.all([Note.count({ createdAt: { - $gte: new Date(Date.now() - 3000) + $gte: new Date(Date.now() - interval) } }), Note.count({ createdAt: { - $gte: new Date(Date.now() - 3000) + $gte: new Date(Date.now() - interval) }, '_user.host': null })]); @@ -17,4 +19,4 @@ setInterval(async () => { }; process.send(stats); -}, 3000); +}, interval);