change runtimechecklog

This commit is contained in:
joseph le 2023-08-22 14:25:12 +07:00
parent 3408baa60e
commit 2894facdff
1 changed files with 2 additions and 2 deletions

View File

@ -18,7 +18,7 @@ export function runtimeCheckLogs(folderPath) {
fileList.map((file) => {
const filePath = `${folderPath}/${file}`;
if (file?.split(".")[filePath.split(".").length - 1]) {
if (file?.split(".")[filePath.split(".").length - 1] === "log") {
const stats = fs.statSync(filePath);
//scan file today
@ -36,7 +36,7 @@ export function runtimeCheckLogs(folderPath) {
folderWatcher.on("add", async (filePath) => {
//import log new file
console.log(`New file added: ${filePath}`);
if (filePath?.split(".")[filePath.split(".").length - 1]) {
if (filePath?.split(".")[filePath.split(".").length - 1] === "log") {
await LogDetectFile.firstOrCreate(
{ file_name: filePath.split("/")[filePath.split("/").length - 1] },
{ file_name: filePath.split("/")[filePath.split("/").length - 1] }