change runtimeCheckLog

This commit is contained in:
joseph le 2023-10-04 09:12:46 +07:00
parent ec3fbfc857
commit e71c36441e
1 changed files with 6 additions and 3 deletions

View File

@ -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)