update alram

This commit is contained in:
Admin 2025-09-25 09:05:15 +07:00
parent ac7edfbc8b
commit a286e814b2
1 changed files with 2 additions and 2 deletions

View File

@ -18,7 +18,7 @@ export class LogsService {
) {}
async saveLog(data: SendLogDto) {
const thirtyMinutesAgo = new Date(Date.now() - 30 * 60 * 1000);
const oneHourAgo = new Date(Date.now() - 60 * 60 * 1000);
// 1. Check nếu đã có log trùng trong 30 phút
const existingLog = await this.repo
@ -26,7 +26,7 @@ export class LogsService {
.where('log.message = :message', { message: data.message })
.andWhere('log.type = :type', { type: data.type })
.andWhere('log.created_at > :time', {
time: thirtyMinutesAgo.toISOString(),
time: oneHourAgo.toISOString(),
}) // convert sang ISO
.getOne();