mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-24 04:59:06 +01:00
23 lines
378 B
TypeScript
23 lines
378 B
TypeScript
import Note from './models/note';
|
|
|
|
const interval = 5000;
|
|
|
|
setInterval(async () => {
|
|
const [all, local] = await Promise.all([Note.count({
|
|
createdAt: {
|
|
$gte: new Date(Date.now() - interval)
|
|
}
|
|
}), Note.count({
|
|
createdAt: {
|
|
$gte: new Date(Date.now() - interval)
|
|
},
|
|
'_user.host': null
|
|
})]);
|
|
|
|
const stats = {
|
|
all, local
|
|
};
|
|
|
|
process.send(stats);
|
|
}, interval);
|