fix error: Field 'id_file' doesn't have a default value
This commit is contained in:
		
							parent
							
								
									5e4d020e1d
								
							
						
					
					
						commit
						cd25aa7aae
					
				| 
						 | 
					@ -102,7 +102,7 @@ export async function runtimeCheckLogs(folderPath) {
 | 
				
			||||||
      try {
 | 
					      try {
 | 
				
			||||||
        //only check new file ---> fileList - fileList_old = new file
 | 
					        //only check new file ---> fileList - fileList_old = new file
 | 
				
			||||||
        let listFileWatch = fileList
 | 
					        let listFileWatch = fileList
 | 
				
			||||||
          ?.filter((i) => fileList_old.includes(i) === false)
 | 
					          ?.filter((i) => fileList_old.includes(i) === false && i.includes(".log"))
 | 
				
			||||||
          .map((file) => folderPath + "/" + file);
 | 
					          .map((file) => folderPath + "/" + file);
 | 
				
			||||||
        const watcher = chokidar.watch(listFileWatch, {
 | 
					        const watcher = chokidar.watch(listFileWatch, {
 | 
				
			||||||
          persistent: true,
 | 
					          persistent: true,
 | 
				
			||||||
| 
						 | 
					@ -213,7 +213,6 @@ export async function runtimeCheckLogs(folderPath) {
 | 
				
			||||||
                      }
 | 
					                      }
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    // if(checkSpecialVersion())
 | 
					 | 
				
			||||||
                  });
 | 
					                  });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if (
 | 
					                if (
 | 
				
			||||||
| 
						 | 
					@ -256,7 +255,7 @@ export async function runtimeCheckLogs(folderPath) {
 | 
				
			||||||
              listKeyValues
 | 
					              listKeyValues
 | 
				
			||||||
                .map((obj) => obj.$original.value)
 | 
					                .map((obj) => obj.$original.value)
 | 
				
			||||||
                .map(async (value) => {
 | 
					                .map(async (value) => {
 | 
				
			||||||
                  // console.log({line:Array(line), value:Array(value)})
 | 
					                  
 | 
				
			||||||
                  if (
 | 
					                  if (
 | 
				
			||||||
                    line.includes(value) &&
 | 
					                    line.includes(value) &&
 | 
				
			||||||
                    listExcludeErr.filter((err) => line.includes(err))
 | 
					                    listExcludeErr.filter((err) => line.includes(err))
 | 
				
			||||||
| 
						 | 
					@ -352,11 +351,7 @@ export async function runtimeCheckLogs(folderPath) {
 | 
				
			||||||
              let logsDetect = allReport_new?.filter(
 | 
					              let logsDetect = allReport_new?.filter(
 | 
				
			||||||
                (i) => i.$original.id_file === fileDetect?.id_ldf
 | 
					                (i) => i.$original.id_file === fileDetect?.id_ldf
 | 
				
			||||||
              );
 | 
					              );
 | 
				
			||||||
              // console.log(logsDetect)
 | 
					              
 | 
				
			||||||
              // await Database.rawQuery(
 | 
					 | 
				
			||||||
              //   "select * from log_reports where id_file = " +
 | 
					 | 
				
			||||||
              //     fileDetect?.id_ldf
 | 
					 | 
				
			||||||
              // );
 | 
					 | 
				
			||||||
              //Get all report newest
 | 
					              //Get all report newest
 | 
				
			||||||
              let listReport = await getListLineByItem(
 | 
					              let listReport = await getListLineByItem(
 | 
				
			||||||
                logsDetect
 | 
					                logsDetect
 | 
				
			||||||
| 
						 | 
					@ -437,13 +432,6 @@ export async function runtimeCheckLogs(folderPath) {
 | 
				
			||||||
        watcher.on("error", (error) => {
 | 
					        watcher.on("error", (error) => {
 | 
				
			||||||
          console.error(`Watcher error: ${error}`);
 | 
					          console.error(`Watcher error: ${error}`);
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
        // await fileList.slice(0,40)
 | 
					 | 
				
			||||||
        //   ?.filter((i) => fileList_old.includes(i) === false)
 | 
					 | 
				
			||||||
        //   ?.forEach((fileName) => {
 | 
					 | 
				
			||||||
        //     //path file
 | 
					 | 
				
			||||||
        //     const filePath = `${folderPath}/${fileName}`;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        //   });
 | 
					 | 
				
			||||||
      } catch (error) {
 | 
					      } catch (error) {
 | 
				
			||||||
        console.log(error);
 | 
					        console.log(error);
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue