Improve performance

This commit is contained in:
syuilo 2019-04-27 11:17:03 +09:00
parent 0cfca4a618
commit c05586b53a
No known key found for this signature in database
GPG Key ID: BDC4C49D06AB9D69
4 changed files with 20 additions and 10 deletions

View File

@ -89,9 +89,11 @@ export default define(meta, async (ps, user) => {
const timeline = await query.take(ps.limit!).getMany(); const timeline = await query.take(ps.limit!).getMany();
process.nextTick(() => {
if (user) { if (user) {
activeUsersChart.update(user); activeUsersChart.update(user);
} }
});
return await Notes.packMany(timeline, user); return await Notes.packMany(timeline, user);
}); });

View File

@ -192,9 +192,11 @@ export default define(meta, async (ps, user) => {
const timeline = await query.take(ps.limit!).getMany(); const timeline = await query.take(ps.limit!).getMany();
process.nextTick(() => {
if (user) { if (user) {
activeUsersChart.update(user); activeUsersChart.update(user);
} }
});
return await Notes.packMany(timeline, user); return await Notes.packMany(timeline, user);
}); });

View File

@ -125,9 +125,11 @@ export default define(meta, async (ps, user) => {
const timeline = await query.take(ps.limit!).getMany(); const timeline = await query.take(ps.limit!).getMany();
process.nextTick(() => {
if (user) { if (user) {
activeUsersChart.update(user); activeUsersChart.update(user);
} }
});
return await Notes.packMany(timeline, user); return await Notes.packMany(timeline, user);
}); });

View File

@ -177,7 +177,11 @@ export default define(meta, async (ps, user) => {
const timeline = await query.take(ps.limit!).getMany(); const timeline = await query.take(ps.limit!).getMany();
process.nextTick(() => {
if (user) {
activeUsersChart.update(user); activeUsersChart.update(user);
}
});
return await Notes.packMany(timeline, user); return await Notes.packMany(timeline, user);
}); });