Update index.ts
This commit is contained in:
parent
ceebd3e11a
commit
0b6e576fa0
|
|
@ -299,7 +299,7 @@ export const buildFlow = async (
|
|||
exploredNode[startingNodeIds[i]] = { remainingLoop: maxLoop, lastSeenDepth: 0 }
|
||||
}
|
||||
|
||||
const initializedNode: Set<string> = new Set()
|
||||
const initializedNodes: Set<string> = new Set()
|
||||
const nonDirectedGraph = constructGraphs(reactFlowNodes, reactFlowEdges, { isReversed: true }).graph
|
||||
while (nodeQueue.length) {
|
||||
const { nodeId, depth } = nodeQueue.shift() as INodeQueue
|
||||
|
|
@ -386,7 +386,7 @@ export const buildFlow = async (
|
|||
flowNodes[nodeIndex].data.instance = outputResult
|
||||
|
||||
logger.debug(`[server]: Finished initializing ${reactFlowNode.data.label} (${reactFlowNode.data.id})`)
|
||||
initializedNode.add(reactFlowNode.data.id)
|
||||
initializedNodes.add(reactFlowNode.data.id)
|
||||
}
|
||||
} catch (e: any) {
|
||||
logger.error(e)
|
||||
|
|
@ -409,8 +409,8 @@ export const buildFlow = async (
|
|||
for (let i = 0; i < neighbourNodeIds.length; i += 1) {
|
||||
const neighNodeId = neighbourNodeIds[i]
|
||||
if (ignoreNodeIds.includes(neighNodeId)) continue
|
||||
if (initializedNode.has(neighNodeId)) continue
|
||||
if (nonDirectedGraph[neighNodeId].some((dependId) => !initializedNode.has(dependId))) continue
|
||||
if (initializedNodes.has(neighNodeId)) continue
|
||||
if (nonDirectedGraph[neighNodeId].some((dependId) => !initializedNodes.has(dependId))) continue
|
||||
// If nodeId has been seen, cycle detected
|
||||
if (Object.prototype.hasOwnProperty.call(exploredNode, neighNodeId)) {
|
||||
const { remainingLoop, lastSeenDepth } = exploredNode[neighNodeId]
|
||||
|
|
|
|||
Loading…
Reference in New Issue