update index.js

main
MohammadHoseinPaymard 2 weeks ago
parent a63f7e92ef
commit b24b6f700f
  1. 15
      index.js

@ -10,7 +10,6 @@ require(path.join(process.cwd(), "..", "server", "dist", "database.js"));
(async function () { (async function () {
await sleep(5e3); await sleep(5e3);
console.time("WorkflowTester") console.time("WorkflowTester")
console.log("initilizing begin.."); console.log("initilizing begin..");
const workflows = await getAllWorkflows({ const workflows = await getAllWorkflows({
@ -105,6 +104,9 @@ require(path.join(process.cwd(), "..", "server", "dist", "database.js"));
} }
//----------------------------------------------------------------------------------------
// console.log("allWorkFlowInfo", JSON.stringify(allWorkFlowInfo, null, 2)); // console.log("allWorkFlowInfo", JSON.stringify(allWorkFlowInfo, null, 2));
// fs.writeFileSync("./result-pretty.json", JSON.stringify(allWorkFlowInfo, null, 2)); // fs.writeFileSync("./result-pretty.json", JSON.stringify(allWorkFlowInfo, null, 2));
// await saveLargeObject(allWorkFlowInfo, "./result-pretty-beforeProcess.json") // await saveLargeObject(allWorkFlowInfo, "./result-pretty-beforeProcess.json")
@ -112,6 +114,8 @@ require(path.join(process.cwd(), "..", "server", "dist", "database.js"));
//invalid haro ham dar yek araye zakhire kon //invalid haro ham dar yek araye zakhire kon
//----------------------------------------------------------------------------------------
for await(let key of Object.keys(allWorkFlowInfo)){ for await(let key of Object.keys(allWorkFlowInfo)){
if (!allWorkFlowInfo[key].isValid) { if (!allWorkFlowInfo[key].isValid) {
console.log(`workflow with id:'${key}' in invalid`); console.log(`workflow with id:'${key}' in invalid`);
@ -126,9 +130,12 @@ require(path.join(process.cwd(), "..", "server", "dist", "database.js"));
for await(const workflow of Object.keys(allWorkFlowInfo)){ for await(const workflow of Object.keys(allWorkFlowInfo)){
if(workflow==57){ if(workflow==57){
const data = allWorkFlowInfo[workflow]; const data = allWorkFlowInfo[workflow];
const paths = data?.root?.validPaths || []; const pathsCollection = data?.root?.validPaths || [];
if(paths?.length==0) allWorkFlowInfo[key].isValid = false; if(pathsCollection?.length==0) allWorkFlowInfo[key].isValid = false;
console.log(paths); for await(let pathString of pathsCollection){
const path = pathString.split(",");
console.log("path",path);
}
return; return;
} }
} }

Loading…
Cancel
Save