mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-29 09:01:06 +03:00
Update index.ts
This commit is contained in:
@@ -300,7 +300,7 @@ export const buildFlow = async (
|
|||||||
}
|
}
|
||||||
|
|
||||||
const initializedNodes: Set<string> = new Set()
|
const initializedNodes: Set<string> = new Set()
|
||||||
const nonDirectedGraph = constructGraphs(reactFlowNodes, reactFlowEdges, { isReversed: true }).graph
|
const reversedGraph = constructGraphs(reactFlowNodes, reactFlowEdges, { isReversed: true }).graph
|
||||||
while (nodeQueue.length) {
|
while (nodeQueue.length) {
|
||||||
const { nodeId, depth } = nodeQueue.shift() as INodeQueue
|
const { nodeId, depth } = nodeQueue.shift() as INodeQueue
|
||||||
|
|
||||||
@@ -410,7 +410,7 @@ export const buildFlow = async (
|
|||||||
const neighNodeId = neighbourNodeIds[i]
|
const neighNodeId = neighbourNodeIds[i]
|
||||||
if (ignoreNodeIds.includes(neighNodeId)) continue
|
if (ignoreNodeIds.includes(neighNodeId)) continue
|
||||||
if (initializedNodes.has(neighNodeId)) continue
|
if (initializedNodes.has(neighNodeId)) continue
|
||||||
if (nonDirectedGraph[neighNodeId].some((dependId) => !initializedNodes.has(dependId))) continue
|
if (reversedGraph[neighNodeId].some((dependId) => !initializedNodes.has(dependId))) continue
|
||||||
// If nodeId has been seen, cycle detected
|
// If nodeId has been seen, cycle detected
|
||||||
if (Object.prototype.hasOwnProperty.call(exploredNode, neighNodeId)) {
|
if (Object.prototype.hasOwnProperty.call(exploredNode, neighNodeId)) {
|
||||||
const { remainingLoop, lastSeenDepth } = exploredNode[neighNodeId]
|
const { remainingLoop, lastSeenDepth } = exploredNode[neighNodeId]
|
||||||
|
|||||||
Reference in New Issue
Block a user