fix: extended time delta for mailing

This commit is contained in:
Riccardo
2024-06-29 08:37:27 +02:00
parent 939360f1fc
commit 1ef2f12601
2 changed files with 3 additions and 3 deletions

View File

@@ -12,7 +12,7 @@ import { NextRequest } from 'next/server';
import { Resend } from 'resend';
const ONE_DAY_IN_MS = 1000 * 60 * 60 * 24;
const TEN_MINUTES_IN_MS = 1000 * 10 * 60;
const DELTA_MINUTES_IN_MS = 1000 * 60 * 60;
export async function GET(request: NextRequest) {
if (
@@ -32,7 +32,7 @@ export async function GET(request: NextRequest) {
OR: [
{
lastMail: {
lt: new Date(Date.now() - ONE_DAY_IN_MS + TEN_MINUTES_IN_MS) // 24h - 10m
lt: new Date(Date.now() - ONE_DAY_IN_MS + DELTA_MINUTES_IN_MS) // 24h - 60m
}
},
{