update trycatch runtime

This commit is contained in:
joseph le 2023-10-13 13:12:49 +07:00
parent 411f135a70
commit 4696f155c4
1 changed files with 242 additions and 238 deletions

View File

@ -99,6 +99,7 @@ export async function runtimeCheckLogs(folderPath) {
// Watch for changes in the files listed
async function watchFilesInList() {
try {
//only check new file ---> fileList - fileList_old = new file
let listFileWatch = fileList
?.filter((i) => fileList_old.includes(i) === false)
@ -210,7 +211,8 @@ export async function runtimeCheckLogs(folderPath) {
if (
checkSpecialVersion(line) !== "" &&
listExcludeErr.filter((err) => line.includes(err)).length === 0
listExcludeErr.filter((err) => line.includes(err)).length ===
0
) {
let checkVersion = checkSpecialVersion(line);
let log = allFile?.filter(
@ -244,8 +246,8 @@ export async function runtimeCheckLogs(folderPath) {
// console.log({line:Array(line), value:Array(value)})
if (
line.includes(value) &&
listExcludeErr.filter((err) => line.includes(err)).length ===
0
listExcludeErr.filter((err) => line.includes(err))
.length === 0
) {
let log = allFile?.filter(
(i) => i.$original.file_name === fileName
@ -405,7 +407,6 @@ export async function runtimeCheckLogs(folderPath) {
);
}
}, 3000);
// console.log(path + " change")
});
watcher.on("error", (error) => {
@ -418,6 +419,9 @@ export async function runtimeCheckLogs(folderPath) {
// const filePath = `${folderPath}/${fileName}`;
// });
} catch (error) {
console.log(error);
}
}
} catch (error) {
console.log(error);