update interval watch file && update config database
This commit is contained in:
		
							parent
							
								
									3fae2b6bb9
								
							
						
					
					
						commit
						25f2dc81a3
					
				| 
						 | 
					@ -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;
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue