diff --git a/src/services/rate-limit.ts b/src/services/rate-limit.ts index a1e08b6..83ccd3f 100644 --- a/src/services/rate-limit.ts +++ b/src/services/rate-limit.ts @@ -50,7 +50,12 @@ export class RateLimiter { } static shouldNotify(userId: string, now: number = Date.now()): boolean { - const last = this.lastNotifyAt.get(userId) || 0; + const last = this.lastNotifyAt.get(userId); + // Si nunca se ha notificado, permitir notificar inmediatamente + if (last === undefined) { + this.lastNotifyAt.set(userId, now); + return true; + } if (now - last >= this.NOTIFY_COOLDOWN_MS) { this.lastNotifyAt.set(userId, now); return true;