Improve performance

This commit is contained in:
syuilo 2019-04-27 11:17:03 +09:00
parent 83641d99f7
commit a675d557aa
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();
if (user) { process.nextTick(() => {
activeUsersChart.update(user); if (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();
if (user) { process.nextTick(() => {
activeUsersChart.update(user); if (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();
if (user) { process.nextTick(() => {
activeUsersChart.update(user); if (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();
activeUsersChart.update(user); process.nextTick(() => {
if (user) {
activeUsersChart.update(user);
}
});
return await Notes.packMany(timeline, user); return await Notes.packMany(timeline, user);
}); });