From 14f916c6284d5a2ad5870ebe7ed5d21264801b3a Mon Sep 17 00:00:00 2001 From: Dan Reeves Date: Mon, 13 Nov 2023 00:56:18 +0000 Subject: [PATCH] Limit mission history to 12 hours --- app/services/db/missionInstances.server.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/services/db/missionInstances.server.ts b/app/services/db/missionInstances.server.ts index 9cfe042..e9efd63 100644 --- a/app/services/db/missionInstances.server.ts +++ b/app/services/db/missionInstances.server.ts @@ -2,11 +2,11 @@ import type { MissionInstance } from "@prisma/client" import { prisma } from "~/services/prisma.server" export async function getMissionHistory() { - let dayAgo = Date.now() - 24 * 60 * 60 * 1000 - let dayAgoString = new Date(dayAgo).toISOString() + let twelveHoursAgo = Date.now() - 12 * 60 * 60 * 1000 + let twelveHoursAgoString = new Date(twelveHoursAgo).toISOString() return await prisma.missionInstance.findMany({ - where: { start: { gte: dayAgoString } }, + where: { start: { gte: twelveHoursAgoString } }, orderBy: { start: "desc", },