perf(editor): Optimize log entries calculation with throttled watcher (no-changelog) (#18486)

This commit is contained in:
Alex Grozav
2025-08-26 13:45:35 +01:00
committed by GitHub
parent 38f25d74eb
commit 71ff4d8b6b
8 changed files with 79 additions and 32 deletions

View File

@@ -192,24 +192,7 @@ function findLogEntryToAutoSelect(subTree: LogEntry[]): LogEntry | undefined {
return subTree[subTree.length - 1];
}
export function createLogTree(
workflow: Workflow,
response: IExecutionResponse,
workflows: Record<string, Workflow> = {},
subWorkflowData: Record<string, IRunExecutionData> = {},
) {
return createLogTreeRec({
parent: undefined,
ancestorRunIndexes: [],
executionId: response.id,
workflow,
workflows,
data: response.data ?? { resultData: { runData: {} } },
subWorkflowData,
});
}
function createLogTreeRec(context: LogTreeCreationContext) {
function createLogTreeRec(context: LogTreeCreationContext): LogEntry[] {
const runData = context.data.resultData.runData;
return Object.entries(runData)
@@ -258,6 +241,23 @@ function createLogTreeRec(context: LogTreeCreationContext) {
.sort(sortLogEntries);
}
export function createLogTree(
workflow: Workflow,
response: IExecutionResponse,
workflows: Record<string, Workflow> = {},
subWorkflowData: Record<string, IRunExecutionData> = {},
): LogEntry[] {
return createLogTreeRec({
parent: undefined,
ancestorRunIndexes: [],
executionId: response.id,
workflow,
workflows,
data: response.data ?? { resultData: { runData: {} } },
subWorkflowData,
});
}
export function findLogEntryRec(
isMatched: (entry: LogEntry) => boolean,
entries: LogEntry[],