change runtimechecklog
This commit is contained in:
parent
3408baa60e
commit
2894facdff
|
|
@ -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] }
|
||||
|
|
|
|||
Loading…
Reference in New Issue