1
0
mirror of https://github.com/hotomoe/hotomoe synced 2024-12-02 00:38:14 +09:00
This commit is contained in:
syuilo 2018-06-09 10:12:03 +09:00
parent e166ad6780
commit 763676a18c

View File

@ -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);