mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2024-11-17 09:36:28 +01:00
21 lines
342 B
TypeScript
21 lines
342 B
TypeScript
|
import Note from './models/note';
|
||
|
|
||
|
setInterval(async () => {
|
||
|
const [all, local] = await Promise.all([Note.count({
|
||
|
createdAt: {
|
||
|
$gte: new Date(Date.now() - 3000)
|
||
|
}
|
||
|
}), Note.count({
|
||
|
createdAt: {
|
||
|
$gte: new Date(Date.now() - 3000)
|
||
|
},
|
||
|
'_user.host': null
|
||
|
})]);
|
||
|
|
||
|
const stats = {
|
||
|
all, local
|
||
|
};
|
||
|
|
||
|
process.send(stats);
|
||
|
}, 3000);
|