mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-05 01:55:36 +02:00
This commit is contained in:
20
src/notes-stats-child.ts
Normal file
20
src/notes-stats-child.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
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);
|
||||
Reference in New Issue
Block a user