Skip to content

Commit

Permalink
Spin UI is becoming unresponsive if we click on pipeline configuration (
Browse files Browse the repository at this point in the history
  • Loading branch information
NagendraOpsmx authored Sep 19, 2024
1 parent 01cb93f commit e3e0f91
Showing 1 changed file with 15 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,16 +165,22 @@ export class PipelineConfigService {
if (!map || !stage) {
return [];
}
let downstreamStages: Array<string | number> = [];

const children = map.get(stage);
if (children && children.length) {
downstreamStages = downstreamStages.concat(children);
children.forEach((child) => {
downstreamStages = downstreamStages.concat(PipelineConfigService.getDownstreamStageIds(map, child));
});
const downstreamStages = new Set<string | number>();
const pipeStages = [stage];

while (pipeStages.length > 0) {
const currentStage = pipeStages.pop();
const children = currentStage ? map.get(currentStage) : null;
if (children) {
for (const child of children) {
if (!downstreamStages.has(child)) {
downstreamStages.add(child);
pipeStages.push(child);
}
}
}
}
return uniq(downstreamStages);
return Array.from(downstreamStages);
}

public static getDependencyCandidateStages(pipeline: IPipeline, stage: IStage): IStage[] {
Expand Down

0 comments on commit e3e0f91

Please sign in to comment.