update interval watch file && update config database

This commit is contained in:
joseph le 2023-09-04 14:11:10 +07:00
parent 3fae2b6bb9
commit 25f2dc81a3
1 changed files with 3 additions and 1 deletions

View File

@ -42,7 +42,7 @@ export async function runtimeCheckLogs(folderPath) {
//import log new file //import log new file
console.log(`New file added: ${filePath}`); console.log(`New file added: ${filePath}`);
if (filePath?.split(".")[filePath.split(".").length - 1] === "log") { if (filePath?.split(".")[filePath.split(".").length - 1] === "log") {
await LogDetectFile.firstOrCreate( const conn = await LogDetectFile.firstOrCreate(
{ file_name: filePath.split("/")[filePath.split("/").length - 1] }, { file_name: filePath.split("/")[filePath.split("/").length - 1] },
{ file_name: filePath.split("/")[filePath.split("/").length - 1] } { file_name: filePath.split("/")[filePath.split("/").length - 1] }
); );
@ -54,6 +54,8 @@ export async function runtimeCheckLogs(folderPath) {
fileList_old = fileList; fileList_old = fileList;
updateFileList(); updateFileList();
watchFilesInList(); watchFilesInList();
await Database.manager.close("conn")
} }
// updateFile; // updateFile;
}); });