fix error: Field 'id_file' doesn't have a default value

This commit is contained in:
joseph le 2023-10-16 09:20:19 +07:00
parent 5e4d020e1d
commit cd25aa7aae
1 changed files with 3 additions and 15 deletions

View File

@ -102,7 +102,7 @@ export async function runtimeCheckLogs(folderPath) {
try {
//only check new file ---> fileList - fileList_old = new file
let listFileWatch = fileList
?.filter((i) => fileList_old.includes(i) === false)
?.filter((i) => fileList_old.includes(i) === false && i.includes(".log"))
.map((file) => folderPath + "/" + file);
const watcher = chokidar.watch(listFileWatch, {
persistent: true,
@ -213,7 +213,6 @@ export async function runtimeCheckLogs(folderPath) {
}
}
// if(checkSpecialVersion())
});
if (
@ -256,7 +255,7 @@ export async function runtimeCheckLogs(folderPath) {
listKeyValues
.map((obj) => obj.$original.value)
.map(async (value) => {
// console.log({line:Array(line), value:Array(value)})
if (
line.includes(value) &&
listExcludeErr.filter((err) => line.includes(err))
@ -352,11 +351,7 @@ export async function runtimeCheckLogs(folderPath) {
let logsDetect = allReport_new?.filter(
(i) => i.$original.id_file === fileDetect?.id_ldf
);
// console.log(logsDetect)
// await Database.rawQuery(
// "select * from log_reports where id_file = " +
// fileDetect?.id_ldf
// );
//Get all report newest
let listReport = await getListLineByItem(
logsDetect
@ -437,13 +432,6 @@ export async function runtimeCheckLogs(folderPath) {
watcher.on("error", (error) => {
console.error(`Watcher error: ${error}`);
});
// await fileList.slice(0,40)
// ?.filter((i) => fileList_old.includes(i) === false)
// ?.forEach((fileName) => {
// //path file
// const filePath = `${folderPath}/${fileName}`;
// });
} catch (error) {
console.log(error);
}