change runtimeCheckLog
This commit is contained in:
		
							parent
							
								
									65535a3ba4
								
							
						
					
					
						commit
						0ebebdd7f0
					
				| 
						 | 
				
			
			@ -153,40 +153,40 @@ export async function runtimeCheckLogs(folderPath) {
 | 
			
		|||
            .map((obj) => obj.$original.value);
 | 
			
		||||
 | 
			
		||||
          //Process file content
 | 
			
		||||
          contentFile.map((line, index) => {
 | 
			
		||||
            //check line the line with errors and exclude errors
 | 
			
		||||
            listKeyValues
 | 
			
		||||
              .map((obj) => obj.$original.value)
 | 
			
		||||
              .map(async (value) => {
 | 
			
		||||
                if (
 | 
			
		||||
                  line.search(value) !== -1 &&
 | 
			
		||||
                  listExcludeErr.filter((err) => line.includes(err))
 | 
			
		||||
                    .length === 0
 | 
			
		||||
                ) {
 | 
			
		||||
                  let log = allFile?.filter(
 | 
			
		||||
                    (i) => i.$original.file_name === fileName
 | 
			
		||||
                  )[0];
 | 
			
		||||
          // contentFile.map((line, index) => {
 | 
			
		||||
          //   //check line the line with errors and exclude errors
 | 
			
		||||
          //   listKeyValues
 | 
			
		||||
          //     .map((obj) => obj.$original.value)
 | 
			
		||||
          //     .map(async (value) => {
 | 
			
		||||
          //       if (
 | 
			
		||||
          //         line.search(value) !== -1 &&
 | 
			
		||||
          //         listExcludeErr.filter((err) => line.includes(err))
 | 
			
		||||
          //           .length === 0
 | 
			
		||||
          //       ) {
 | 
			
		||||
          //         let log = allFile?.filter(
 | 
			
		||||
          //           (i) => i.$original.file_name === fileName
 | 
			
		||||
          //         )[0];
 | 
			
		||||
 | 
			
		||||
                  let checkLog = allReport?.filter(
 | 
			
		||||
                    (report) =>
 | 
			
		||||
                      report.$original.id_file === log?.id_ldf &&
 | 
			
		||||
                      report.$original.line === index + 1 &&
 | 
			
		||||
                      report.$original.detected_content === value
 | 
			
		||||
                  );
 | 
			
		||||
          //         let checkLog = allReport?.filter(
 | 
			
		||||
          //           (report) =>
 | 
			
		||||
          //             report.$original.id_file === log?.id_ldf &&
 | 
			
		||||
          //             report.$original.line === index + 1 &&
 | 
			
		||||
          //             report.$original.detected_content === value
 | 
			
		||||
          //         );
 | 
			
		||||
 | 
			
		||||
                  if (checkLog?.length === 0) {
 | 
			
		||||
                    // await LogReport.create({
 | 
			
		||||
                    //   detected_content: value,
 | 
			
		||||
                    //   line: index + 1,
 | 
			
		||||
                    //   id_file: log?.id_ldf,
 | 
			
		||||
                    // });
 | 
			
		||||
                    lines.push(index + 1);
 | 
			
		||||
                  }
 | 
			
		||||
                }
 | 
			
		||||
          //         if (checkLog?.length === 0) {
 | 
			
		||||
          //           // await LogReport.create({
 | 
			
		||||
          //           //   detected_content: value,
 | 
			
		||||
          //           //   line: index + 1,
 | 
			
		||||
          //           //   id_file: log?.id_ldf,
 | 
			
		||||
          //           // });
 | 
			
		||||
          //           lines.push(index + 1);
 | 
			
		||||
          //         }
 | 
			
		||||
          //       }
 | 
			
		||||
 | 
			
		||||
                // if(checkSpecialVersion())
 | 
			
		||||
              });
 | 
			
		||||
          });
 | 
			
		||||
          //       // if(checkSpecialVersion())
 | 
			
		||||
          //     });
 | 
			
		||||
          // });
 | 
			
		||||
 | 
			
		||||
          //true: import log to log_report table, send report to Zulip
 | 
			
		||||
          // setTimeout(async () => {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue