diff --git a/app/utils/runtimeCheckLogs.ts b/app/utils/runtimeCheckLogs.ts index bd497cf..68af835 100644 --- a/app/utils/runtimeCheckLogs.ts +++ b/app/utils/runtimeCheckLogs.ts @@ -9,7 +9,7 @@ import Database from "@ioc:Adonis/Lucid/Database"; import { sendMessToZulip } from "./sendMessToZulip"; import { getListLineByItem } from "./getListLineByItem"; import { checkIndexSN } from "./checkIndexSN"; - +import { DateTime } from "luxon"; export async function runtimeCheckLogs(folderPath) { try { let fileList = Array(); @@ -102,10 +102,13 @@ export async function runtimeCheckLogs(folderPath) { const fileName = path.split("/")[path.split("/").length - 1] const filePath = path let lines = []; + const today = DateTime.now().toFormat('yyyy-MM-dd'); let allFile = await LogDetectFile.all(); - let allReport = await LogReport.all(); + // let allReport = await LogReport.all(); let allValue = await KeyValue.all(); - + const allReport = await LogReport.query() + .whereRaw(`DATE(created_at) = ?`, [today]) + .fetch(); console.log(allReport)