perf(backend): createdAtをidから取得するように & 無駄なDateインスタンスの生成を避けるように
This commit is contained in:
@@ -47,13 +47,13 @@ export class AggregateRetentionProcessorService {
|
||||
// 今日登録したユーザーを全て取得
|
||||
const targetUsers = await this.usersRepository.findBy({
|
||||
host: IsNull(),
|
||||
createdAt: MoreThan(new Date(Date.now() - (1000 * 60 * 60 * 24))),
|
||||
id: MoreThan(this.idService.gen(Date.now() - (1000 * 60 * 60 * 24))),
|
||||
});
|
||||
const targetUserIds = targetUsers.map(u => u.id);
|
||||
|
||||
try {
|
||||
await this.retentionAggregationsRepository.insert({
|
||||
id: this.idService.genId(),
|
||||
id: this.idService.gen(),
|
||||
createdAt: now,
|
||||
updatedAt: now,
|
||||
dateKey,
|
||||
|
Reference in New Issue
Block a user